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

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

bug#48572: 28.0.50; Add `passthrough` completion style to minibuffer.el


From: Daniel Mendler
Subject: bug#48572: 28.0.50; Add `passthrough` completion style to minibuffer.el
Date: Sun, 23 May 2021 12:21:33 +0200

On 5/23/21 1:20 AM, Stefan Monnier wrote:
>> (defun passthrough-all-completions (_str table pred _point)
>>   "Passthrough completion function.
>> See `completion-all-completions' for the arguments STR, TABLE, PRED and
>> POINT."
>>   (let ((completion-regexp-list))
>>     (all-completions "" table pred)))
> 
> Clearly, this is not right: passthrough completion should pass the `str`
> and `point` info to the completion table.  The completion table may opt
> to ignore that information, but we shouldn't prevent them from using it.
> I expect most passthrough uses will want to use `str`.

I see what you mean. In my use case I didn't use an improperly
implemented completion table which does not ignore . However the
question is then if this "passthrough" style is really needed since if
you don't ignore the input, it is mostly equivalent to the emacs21 style.

It is at least good to discuss this. I think all use cases of the
passthrough table are a bit of an edge case (or broken tables in the
strict definition), e.g., my fuzzy finder or eglot.

> Furthermore, `all-completions` and `try-completion` on a completion
> table is defined as returning only the prefix completion, so the above
> code would force `table` to be a "broken" completion table that doesn't
> obey the normal completion table API.

Well, it forces the table to return all candidates.

Overall it seems that the passthrough you have in mind is already
covered by the emacs21 style. I had considered something different which
effectively disables the full completion infrastructure. Maybe these use
cases are too special to be catered for by minibuffer.el?

I have to think a bit more about this. Probably I can achieve the same
in my fuzzy finder using the emacs21 style.

Daniel





reply via email to

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