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

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

bug#77718: 31.0.50; completion styles substring and flex are broken


From: Stephen Berman
Subject: bug#77718: 31.0.50; completion styles substring and flex are broken
Date: Tue, 29 Apr 2025 12:19:11 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

On Mon, 28 Apr 2025 14:01:18 -0400 Stefan Monnier <monnier@iro.umontreal.ca> 
wrote:

>> But actually there's a simpler and better way to do that: just duplicate
>> all the $s to $$, then substitute-in-file-name turns all the $$ back to
>> $ without expanding environment variables.  So I did that in the
>> attached updated patch.
>
> LGTM, pushed to `master`.

This patch causes two regressions wrt emacs-30.  One I pointed out
upthread (<87a58hal6w.fsf@gmx.net>,
<https://lists.gnu.org/archive/html/bug-gnu-emacs/2025-04/msg00884.html>).
For this, the following patch fixes the regression according to my
testing:

Attachment: txtsOVzegQPVN.txt
Description: completion-pcm--merge-completions patch

For the other regression, here is a reproducer:

0. mkdir /tmp/{Test,retest}
1. emacs -Q --eval "(custom-set-variables                        \
   '(completion-category-overrides '((file (styles substring)))) \
   '(read-file-name-completion-ignore-case t))"
2. Type `C-x d /tmp/tes TAB': this completes to /tmp/test/
3. Type TAB again: Emacs dings and shows "[no match]"

If you repeat this recipe in emacs-30, then after the TAB in step 3, this
completion is shown: /tmp/Test/. and typing TAB again pops up the
*Completions* buffer displaying the two completions ../ and ./

While the result in emacs-30 seems suboptimal, since it omits the
possible completion /tmp/retest/, still it's better than "[no match]".

A workaround for both emacs-30 and master is to enter at step 2 `C-x d
/tmp/*tes TAB'. This shows the completion /tmp/*test/, then hitting TAB
again shows /tmp/*test/., and hitting TAB a third time pops up the
*Completions* buffer showing the four completions Test/../, Test/./,
retest/../, and retest/./

Steve Berman

reply via email to

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