emacs-devel
[Top][All Lists]
Advanced

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

Re: scratch/backend-completion 9a62da21c2 1/2: Integrate Stefan suggesti


From: Stefan Monnier
Subject: Re: scratch/backend-completion 9a62da21c2 1/2: Integrate Stefan suggestions but rename it to "external-completion.el"
Date: Sat, 03 Dec 2022 19:31:08 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>> > +TRY-COMPLETION-FUNCTION is an poorly understood implementation detail.
>>
>> Not at all.  It's a functionality that only makes sense for some UIs
>> (not those based on the idea of selecting among a set of choices), and
>> it tends to work better with more "primitive" completion styles (it
>> asymptotically becomes useless the harder the completion style tries to
>> find completions).
>
> I'm still confused, I need examples to understand this stuff, and I'm afraid

E.g. for the completion table of ELisp commands the `try-completion` for
the `partial-completion` style of "r-bu" might be "re-bu" because all
the completion candidates of "r-bu" have an "e" right after the "r", so
"re-bu" selects exactly the same set of candidates.  Similarly for
"di-hu" it may return "diff-hunk" because all the candidates have "ff"
after the "di" and "nk" after the "-hu".

This is the standard "TAB completion" behavior: instead of asking you to
*select* a candidate it "types the text for you" (hence the name
"completion") without trying to guess which candidate you're going to go
for: its only "guess" is that your goal is somewhere among
the candidates.

For prefix completion, it works great.
For completion styles like `flex`, it's rarely able to complete anything.


        Stefan




reply via email to

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