all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 68022@debbugs.gnu.org
Subject: bug#68022: 30.0.50; File cache completions accumulate instead of replacing minibuffer input
Date: Mon, 25 Dec 2023 16:41:27 +0100	[thread overview]
Message-ID: <m134vqxpaw.fsf@dazzs-mbp.home> (raw)
In-Reply-To: <83sf3q9vbi.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 25 Dec 2023 17:05:21 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Eshel Yaron <me@eshelyaron.com>
>> Cc: 68022@debbugs.gnu.org
>> Date: Mon, 25 Dec 2023 14:47:52 +0100
>>
>> Eli Zaretskii <eliz@gnu.org> 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?

`M-x file-cache-display` should show the cache contents.

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

Sure, here's what I see after `M-x keep-lines RET mini RET` in the
output buffer of `M-x file-cache-display`:

--8<---------------cut here---------------start------------->8---
/Users/eshelyaron/emacs-29.1/src/deps/minibuf.d
/Users/eshelyaron/emacs-29.1/src/minibuf.c
/Users/eshelyaron/emacs-29.1/native-lisp/29_1_50-1fe1a1fd/preloaded/minibuffer-1b0f548b-7af20c5f.eln
/Users/eshelyaron/emacs-29.1/doc/emacs/mini.texi
/Users/eshelyaron/emacs-29.1/doc/lispref/minibuf.texi
/Users/eshelyaron/emacs-29.1/lib/mini-gmp.c
/Users/eshelyaron/emacs-29.1/lib/mini-gmp.h
/Users/eshelyaron/emacs-29.1/lib/mini-gmp-gnulib.c
/Users/eshelyaron/emacs-29.1/test/src/minibuf-tests.el
/Users/eshelyaron/emacs-29.1/test/lisp/minibuffer-tests.el
/Users/eshelyaron/emacs-29.1/test/lisp/minibuffer-resources/data/minibuffer-test-cttq$tion
/Users/eshelyaron/emacs-29.1/test/lisp/minibuffer-resources/lisp/cedet/semantic-utest-c.test
/Users/eshelyaron/emacs-29.1/test/lisp/minibuffer-resources/lisp/cedet/semantic-utest.test
/Users/eshelyaron/emacs-29.1/test/lisp/minibuffer-resources
/Users/eshelyaron/emacs-29.1/lisp/minibuf-eldef.el
/Users/eshelyaron/emacs-29.1/lisp/minibuffer.el
/Users/eshelyaron/emacs-29.1/lisp/use-package/use-package-diminish.el
--8<---------------cut here---------------end--------------->8---

>> > 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?

No, I get more or less the same.


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.


Thanks,

Eshel





  reply	other threads:[~2023-12-25 15:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-25  6:54 bug#68022: 30.0.50; File cache completions accumulate instead of replacing minibuffer input Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-25 12:44 ` Eli Zaretskii
2023-12-25 13:47   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-25 15:05     ` Eli Zaretskii
2023-12-25 15:41       ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-12-25 16:50         ` Eli Zaretskii
2023-12-25 17:35           ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m134vqxpaw.fsf@dazzs-mbp.home \
    --to=bug-gnu-emacs@gnu.org \
    --cc=68022@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=me@eshelyaron.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.