Subject: bug#68022: 30.0.50; File cache completions accumulate instead of replacing minibuffer input

From: Eshel Yaron <[email-masked]>
Date: Mon, 25 Dec 2023 18:35:34 +0100

Eli Zaretskii <[email-masked]> writes:

>> From: Eshel Yaron <[email-masked]>
>> Cc: [email-masked]
>> Date: Mon, 25 Dec 2023 16:41:27 +0100
>>
>> Instead of using `file-cache-add-directory-using-find`, you can also set
>> `file-cache-alist` directly:
>>
>> --8<---------------cut here---------------start------------->8---
>> (setq file-cache-alist
>>       '(("bar" "/foo")
>>         ("baz" "/foo")
>>         ("bad" "/foo")
>>         ("bay" "/foo")
>>         ("ban" "/foo")))
>> --8<---------------cut here---------------end--------------->8---
>>
>> Then `C-x C-f ba C-TAB M-<down> M-<down> ...` should show the issue.
>>
>> Earlier I wrote that the same issue appears in Emacs 29.1, but now I
>> tested that again and I think I might have been mistaken.  In Emacs 29.1
>> I see a different issue: `M-<down>` in the above recipe emits an error:
>>
>> --8<---------------cut here---------------start------------->8---
>> Wrong type argument: number-or-marker-p, ""
>> --8<---------------cut here---------------end--------------->8---
>>
>> and doesn't change the minibuffer contents.
>
> That's what I see in Emacs 29.  So are we talking about one problem or
> two different problems?

Well, the same interaction yields two different unexpected results
depending on which Emacs you're running: in Emacs 29.1 we get an error,
and on master each completion candidate is appended to the previous one
in the minibuffer instead of replacing it.  In both cases, it seems that
`M-<down>` doesn't do the right thing when the *Completions* buffer is
showing file cache completions.