[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-f
From: |
Daniel Mendler |
Subject: |
Re: master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846) |
Date: |
Tue, 14 May 2024 22:58:44 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>> +(defcustom completion-allow-text-properties nil
>>> + "Non-nil means `choose-completion' should not discard text properties.
>>> +This also affects `completing-read' and any of the functions that do
>>> +minibuffer input with completion."
>>
>> This new user option should be announced in NEWS.
>>
>> I also wonder whether it should be a user option, i.e. is it
>> reasonable that a user would like all of his/her completions to
>> preserve text properties? Stefan, WDYT?
>
> I can't see how it can make sense as a user-option, no. AFAICT it's
> a hack for specific front-ends or specific backends (or combinations
> thereof) to work around limitations in the completion API (or maybe
> rather to allow abusing the completion API as a selection API 🙂).
As far as I can tell, both Corfu and Company preserve the text
properties if a candidate is selected explicitly. The same could work
for default completion when operating in "selection mode", i.e., when
the user explicitly selects a candidate explicitly in the *Completions*
buffer. However in the regular mode of operation, where the user
step-wise builds up input in the minibuffer, text properties wouldn't
and shouldn't be preserved.
Preserving text properties during selection can be useful when
distinguishing equal candidates, even if regular completion will
continue to work as is. For example Eglot provides both snippet and
identifier candidates (which may be equal). Then the user can explicitly
select among them. Similarly, Eglot may return equal candidates for
overloaded methods with argument list expansion like in Java.
However I am not sure if my proposal would help with the Imenu duplicate
candidate issue you are discussing here. When completing, the first
equal candidate would win, but the user could perhaps opt-in to select
another one explicitly.
Daniel
- Re: master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846), Eshel Yaron, 2024/05/13
- Re: master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846), Juri Linkov, 2024/05/13
- Re: master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846), Juri Linkov, 2024/05/15
- Re: master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846), Eli Zaretskii, 2024/05/15
- Re: master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846), Eshel Yaron, 2024/05/15
- Re: master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846), Juri Linkov, 2024/05/16
- Re: master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846), Eli Zaretskii, 2024/05/16
- Re: master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846), Juri Linkov, 2024/05/17
- Re: master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846), Stefan Monnier, 2024/05/17
- Re: master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846), Juri Linkov, 2024/05/17
- Re: master 431f8ff1e38: * lisp/imenu.el: Support more values for imenu-flatten (bug#70846), Stefan Monnier, 2024/05/18