From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#68022: 30.0.50; File cache completions accumulate instead of replacing minibuffer input Date: Mon, 25 Dec 2023 16:41:27 +0100 Message-ID: References: <8334vqbge3.fsf@gnu.org> <83sf3q9vbi.fsf@gnu.org> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37657"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 68022@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 25 16:42:19 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rHn5u-0009Yw-R5 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Dec 2023 16:42:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rHn5Y-0003xK-91; Mon, 25 Dec 2023 10:41:56 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rHn5X-0003xC-N5 for bug-gnu-emacs@gnu.org; Mon, 25 Dec 2023 10:41:55 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rHn5X-00015N-Cp for bug-gnu-emacs@gnu.org; Mon, 25 Dec 2023 10:41:55 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rHn5d-0006Tv-O4 for bug-gnu-emacs@gnu.org; Mon, 25 Dec 2023 10:42:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Dec 2023 15:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68022 X-GNU-PR-Package: emacs Original-Received: via spool by 68022-submit@debbugs.gnu.org id=B68022.170351890024884 (code B ref 68022); Mon, 25 Dec 2023 15:42:01 +0000 Original-Received: (at 68022) by debbugs.gnu.org; 25 Dec 2023 15:41:40 +0000 Original-Received: from localhost ([127.0.0.1]:55127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rHn5H-0006TI-UR for submit@debbugs.gnu.org; Mon, 25 Dec 2023 10:41:40 -0500 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:36388 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rHn5E-0006T7-NM for 68022@debbugs.gnu.org; Mon, 25 Dec 2023 10:41:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1703518889; bh=eWrOcRJ5gjR397CssXPTNfvXswh2R48cWiQROMxRcGE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ainISWcesv2mTMSdJRa6DUdDoghkrYxQc/QWyT0zogdjV0x9FaJXuG2g1AEqr0BiY I+t5NdKUktbdNi9+1Snnbw8hlj5dqQKE6DtkX3MM4VauOJNwpdkaIWn7vn+iYqal6G bhUpnvO6fxOldzGHsUDTZMdIpregj14EdzXMusFeESD+IIUKNgTANnT9Ec7pe/iQs9 8ZpaSXO/n8MH09aNcPJKysrwdztxqTr8kHekW25Eh466QzaO07NVibBIW8gg/vP8vE IWggPp2dT2xhXoVELLG8f0OMct9JTel/gTEKwualDyFgSrobt/xhtx+PgCIakz/vTX VfF6FVlhOV5yA== In-Reply-To: <83sf3q9vbi.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 25 Dec 2023 17:05:21 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276867 Archived-At: Eli Zaretskii writes: >> From: Eshel Yaron >> Cc: 68022@debbugs.gnu.org >> Date: Mon, 25 Dec 2023 14:47:52 +0100 >> >> Eli Zaretskii 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- or M- to move >> >> point between completions." >> >> 4. M- M- M- ... >> >> 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- M- ...` 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-` 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