GNU bug report logs -
#76182
31.0.50; minibuffer-allow-text-properties not reliable
Previous Next
Reported by: Visuwesh <visuweshm <at> gmail.com>
Date: Mon, 10 Feb 2025 16:29:01 UTC
Severity: normal
Found in version 31.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #20 received at 76182 <at> debbugs.gnu.org (full text, mbox):
[புதன் பிப்ரவரி 12, 2025] Juri Linkov wrote:
>>> This reminds the recent discussion at
>>> https://lists.gnu.org/archive/html/emacs-devel/2024-05/msg00819.html
>>> that required documenting this limitation in the docstring of
>>> 'imenu-flatten':
>>>
>>> Since the values `annotation' and `group' rely on text properties,
>>> you can use them only by selecting candidates from the completions
>>> buffer, not by typing in the minibuffer. This also means that
>>> if you use `minibuffer-next-completion' (`M-<down>') to select
>>> a completion while point stays in the minibuffer, you need
>>> to customize `minibuffer-completion-auto-choose' to nil that
>>> doesn't insert completion candidates to the minibuffer.
>>
>> If it is much too difficult to make it reliable in all cases, shouldn't
>> this be called out in the docstring of minibuffer-allow-text-properties
>> itself?
>
> Agreed, the docstring of minibuffer-allow-text-properties
> is the most suitable place to document this limitation.
Thank you for taking care of the documentation.
> Regarding to how difficult is to make it reliable,
> a better question is whether it's possible at all.
>
> How could you get text properties from the completion candidate,
> when you type text in the minibuffer and don't use completion?
That is essentially the conclusion I came to too. The best way to
"stash metadata" associated with a completion candidate is to use an
alist or a hashtable (or an obarray??) I suppose (so you would end doing
(alist-get (completing-read ...) candidates nil nil #'equal)).
If that is indeed the conclusion, then this bug can be closed once the
documentation is updated to reflect this limitation.
This bug report was last modified 114 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.