Subject: bug#42149: Substring and flex completion ignore implicit trailing ‘any’

From: João Távora <[email-masked]>
Date: Tue, 08 Sep 2020 12:22:39 +0100

Dario Gjorgjevski <[email-masked]> writes:

>> Is this is vanilla emacs, or are you using some icomplete-mode or
>> fido-mode?
>> I.e. can you post the entire Emacs -Q recipe?
>
> It is really simple to reproduce.
>
> 0. Run ‘emacs -Q’ in a directory with two files: “1” and “foo1”.
> 1. Enable fido-mode.
> 2. C-x C-f 1 RET.
>
> Emacs will open “foo1” even though I would expect it to open “1” as that
> is an exact match.  But, I really think this is a pointless
> discussion.

It's not.  Before, you hadn't mentioned fido-mode.  As I told you, I
need to assess the priority of this bug, in terms of whom it affects and
to what intensity.

> The issue *is not caused by fido-mode* but by the mechanism of substring
> (and therefore, flex) completion.

Obviously, I'm not disputing that in any way.

>> M-j instead of RET in these one-letter completion cases. Or even C-u
>> M-j, if that doesn't work.
>
> Sure, but my muscle memory opposes that.

I'm sorry, but that's the only workaround I can think of.  Bear in mind
that, when using fido-mode, you need to be aware of that shortcut anyway
in some situations where the text you want to input is not among the
completions.  C-c C-w to write a new file would likely be the most
prominent example.

To summarize, I believe this isn't a very common case, and it is easily
circumvented with the workaround I gave you.  I of course acknowledge
this bug report as a bug.  Maybe you can try making a patch for Emacs
that fixes it and test it.

João