GNU bug report logs - #76182
31.0.50; minibuffer-allow-text-properties not reliable

Previous Next

Package: emacs;

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 #11 received at 76182 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 76182 <at> debbugs.gnu.org, Visuwesh <visuweshm <at> gmail.com>
Subject: Re: bug#76182: 31.0.50; minibuffer-allow-text-properties not reliable
Date: Tue, 11 Feb 2025 19:14:05 +0200
>> Despite what the docstring says, setting the variable to t does not seem
>> to be reliable.  Take the following scenario:
>> 
>>         1. emacs -Q
>>         2. Paste in
>>             (let ((cand (list (propertize "test" 'prop 1)
>>                               (propertize "test1" 'prop 2))))
>>               (minibuffer-with-setup-hook
>>                   (lambda ()
>>                     (setq-local minibuffer-allow-text-properties t))
>>                 (get-text-property 0 'prop (completing-read "test: " cand nil t))))
>>            *scratch* buffer or wherever.
>>         3. Evaluate the form.
>>         4. In the minibuffer prompt, type "test" then press RET.
>>         5. Observe how the return value is nil.
>>         6. Evaluate the form again but this time press TAB and RET.
>>         7. Observe how it returns 1 as expected.
>>         8. Evaluate the form again but this time type "te", press TAB,
>>            type "1" and press RET.
>>         9. Observe how it returns nil.  Here if you examine the string
>>            returned, you will find that the text-property is retained
>>            only for indices 2--5.
>> 
>> Is this expected?  I would expect the form to always return the value of
>> the property 'prop' regardless how I completed the string.
>
> Juri, any comments?

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.




This bug report was last modified 83 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.