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

From: Eli Zaretskii <[email-masked]>
Date: Mon, 25 Dec 2023 17:05:21 +0200

> From: Eshel Yaron <[email-masked]>
> Cc: [email-masked]
> Date: Mon, 25 Dec 2023 14:47:52 +0100
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> Date: Mon, 25 Dec 2023 07:54:22 +0100
> >> From:  Eshel Yaron
> >>
> >> With emacs -Q:
> >>
> >> 1. M-x file-cache-add-directory-using-find /path/to/emacs/
> >> 2. C-x C-f mini C-TAB
> >> 3. Observe the *Completions* buffer pop up with file cache
> >> completions, suggesting as usual to "type M-<down> or M-<up> to move
> >> point between completions."
> >> 4. M-<down> M-<down> M-<up> ...
> >> 5. Each candidate you highlight this way is inserted in the minibuffer
> >> after the current input, instead of replacing the appropriate part of
> >> the input.
> >>
> >> I see this already in Emacs 29.1, FWIW.
> >
> > Something is missing in the recipe above, because I get "No match"
> > when I press C-TAB in step 2.  What did I miss?
> 
> Hmm, I'm not sure.  Perhaps `file-cache-add-directory-using-find` didn't
> do its job for some reason?

How do I verify that?  Could you perhaps show at least some of the
cache and tell how to compare that with what I get here?

> > Is the above supposed to work in any Emacs source tree?  Also, what
> > should be the default-directory in step 1 (if it's important) --
> > should it be the root of the Emacs source tree?
> 
> That shouldn't matter, I think, as long as you have several files with
> "mini" in their names in the cache.

If I invoke 'find' from the shell prompt, I get this:

  D:\gnu\git\emacs\branch>find . -name "mini*"
  ./doc/emacs/mini.texi
  ./doc/lispref/minibuf.texi
  ./lib/mini-gmp-gnulib.c
  ./lib/mini-gmp.c
  ./lib/mini-gmp.h
  ./lisp/minibuf-eldef.el
  ./lisp/minibuf-eldef.elc
  ./lisp/minibuffer.el
  ./lisp/minibuffer.elc
  ./src/deps/minibuf.d
  ./src/minibuf.c
  ./src/minibuf.o
  ./test/lisp/minibuffer-resources
  ./test/lisp/minibuffer-resources/data/minibuffer-test-cttq$tion
  ./test/lisp/minibuffer-tests.el
  ./test/lisp/minibuffer-tests.elc
  ./test/src/minibuf-tests.el

Do you get something very different?