help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Completion: display of candidates


From: Stefan Monnier
Subject: Re: Completion: display of candidates
Date: Tue, 19 Feb 2019 10:28:36 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>> For example `partial-completion` (which is included in the default
>> `completion-styles`) does accept * so you can do `M-x r*v*uf TAB` to
>> find revert-buffer.
> Hm, that there can be dependencies between (1) finding completion
> candidates and (2) completion styles doesn't spark joy in my heart.

The completion table is not necessarily looked up with the user's typed
string.  It's meant to be nothing more than a standardized
representation of a *set* of candidates.  How this set is filtered on
the basis of the user's string is under the control of the
completion styles.

> I thought of (1) as a kind of generic backend and (2) as a frontend
> which users select based on personal preference.  But since both have
> to work with the user's input string, I don't see how to make it
> better...

The completion-table does not see "the user's input string".  It only
sees "a string" (chosen by the completion-style) and should return the
set of candidates which have that string as a prefix.  In some cases,
the string it will see is "" and it should hence return the complete
list of candidates (after which the completion style will perform its
own filtering on it).

> Yeah, in the end I've waived my hands and went without text properties
> and just selected a unicode character which is unlikely to be used in
> file names as separator.  The results are quite satisfying.

Great,


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]