Subject: Re: bug#49761: file-cache-minibuffer-complete has become unusable for duplicate file names in MacOSX 27.x emacs

From: Aaron Cohen <[email-masked]>
Date: Mon, 2 Aug 2021 13:12:07 -0700

Oh, and I've confirmed that the workaround of `C-u C-Tab` works great for
cycling through files when `C-Tab` would otherwise get stuck.  So, I'm good
until the next official release.

On Mon, Aug 2, 2021 at 1:02 PM Aaron Cohen <[email-masked]> wrote:

> Very much appreciated!!
>
> And thank you for investigating and isolating the issue: I had
> misidentified the actual problem and didn't provide a duplication recipe,
> making your job much harder.
>
> I promise to do better next time, and provide a test case.  :-)
>
> Thanks again!!
>
> On Sun, Aug 1, 2021 at 1:41 AM Juri Linkov <[email-masked]> wrote:
>
>> tags 49761 fixed
>> close 49761 28.0.50
>> thanks
>>
>> > Well, it's now the default behavior.  It wasn't previously.  :-)
>>
>> And new is not always better ;-)
>>
>> So now the new behavior (that became old now) was fixed
>> in the master branch for Emacs 28, and all test cases
>> that you presented work completely as expected.
>> Thanks for helping to understand where the problem was.
>>
>> BTW, after the fix, the following additional information
>> is not necessary, but I discovered that in old versions
>> you can use the prefix argument to force C-TAB cycling.
>>
>> An excerpt from etc/NEWS.20:
>>
>>   ** file-cache-minibuffer-complete now accepts a prefix argument.
>>   With a prefix argument, it does not try to do completion of
>>   the file name within its directory; it only checks for other
>>   directories that contain the same file name.
>>   Thus, given the file name Makefile, and assuming that a file
>>   Makefile.in exists in the same directory, ordinary
>>   file-cache-minibuffer-complete will try to complete Makefile to
>>   Makefile.in and will therefore never look for other directories that
>>   have Makefile.  A prefix argument tells it not to look for longer
>>   names such as Makefile.in, so that instead it will look for other
>>   directories--just as if the name were already complete in its present
>>   directory.
>>
>> and a comment from bindings.el:
>>
>>   ;; The prefix argument works around a bug in the minibuffer completion.
>>   ;; The completion function doesn't distinguish between the states:
>>   ;;
>>   ;;   "Multiple completions of name" (eg, Makefile, Makefile.in)
>>   ;;   "Name available in multiple directories" (/tmp/Makefile,
>> ~me/Makefile)
>>   ;;
>>   ;; The default is to do the former; a prefix arg forces the latter.
>>
>