From: Daniel Mendler via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: Eli Zaretskii <eliz@gnu.org>,
74616@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer
Date: Sun, 15 Dec 2024 16:29:19 +0100 [thread overview]
Message-ID: <874j359d80.fsf@daniel-mendler.de> (raw)
In-Reply-To: <87bjxdfemi.fsf@daniel-mendler.de> (Daniel Mendler's message of "Sun, 15 Dec 2024 11:02:29 +0100")
[-- Attachment #1: Type: text/plain, Size: 750 bytes --]
Daniel Mendler <mail@daniel-mendler.de> writes:
> Juri Linkov <juri@linkov.net> writes:
>
>>> Thanks for finding this. The problem was that `initial-input' was passed
>>> directly to `completion-metadata'. I replaced `initial-input' with `(or
>>> initial-input "")'. See the updated patch attached to this mail.
>>
>> It seems this change caused another regression: 'ffap' on a file name
>> fails with the error:
>
> Oh, I see. The INITIAL-INPUT argument can be a cons pair too. See the
> patch attached to this mail which fixes the problem.
I've attached an ever better patch to this mail, where the minibuffer
content is simply used directly instead of handling the different
INITIAL-INPUT cases. This is simpler and more future proof.
Daniel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-completion-eager-display-Use-buffer-content-instead-.patch --]
[-- Type: text/x-diff, Size: 1409 bytes --]
From 254c3d7b1ae8224d305aff7f55817c6fd9fca1c5 Mon Sep 17 00:00:00 2001
From: Daniel Mendler <mail@daniel-mendler.de>
Date: Sun, 15 Dec 2024 10:57:59 +0100
Subject: [PATCH] completion-eager-display: Use buffer content instead of
INITIAL-INPUT
* lisp/minibuffer.el (completing-read-default): Use the
minibuffer content instead of handling INITIAL-INPUT directly.
---
lisp/minibuffer.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index dfc62c25f38..91495f9f941 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -4857,8 +4857,10 @@ completing-read-default
;; `completion-eager-display' is t or if eager display
;; has been requested by the completion table.
(when completion-eager-display
- (let* ((md (completion-metadata (or initial-input "")
- collection predicate))
+ (let* ((md (completion-metadata
+ (buffer-substring-no-properties
+ (minibuffer-prompt-end) (point))
+ collection predicate))
(fun (completion-metadata-get md 'eager-display)))
(when (or fun (eq completion-eager-display t))
(funcall (if (functionp fun)
--
2.45.2
next prev parent reply other threads:[~2024-12-15 15:29 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-30 6:42 bug#74616: 30.0.92; tmm always displays the *Completions* buffer Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 8:04 ` Eli Zaretskii
2024-11-30 8:12 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-30 18:55 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-01 4:00 ` Sean Whitton
2024-12-07 12:55 ` Eli Zaretskii
2024-12-07 14:38 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-08 7:17 ` Eli Zaretskii
2024-12-08 7:49 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-08 15:33 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-08 19:59 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-09 14:19 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-09 14:44 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-09 15:25 ` Eli Zaretskii
2024-12-09 15:42 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-09 19:03 ` Juri Linkov
2024-12-09 19:28 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-09 20:06 ` Eli Zaretskii
2024-12-09 20:12 ` Eli Zaretskii
2024-12-09 19:52 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-09 20:08 ` Eli Zaretskii
2024-12-09 20:32 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-10 12:32 ` Eli Zaretskii
2024-12-11 15:37 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-14 10:31 ` Eli Zaretskii
2024-12-14 11:44 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-14 12:40 ` Eli Zaretskii
2024-12-15 7:44 ` Juri Linkov
2024-12-15 10:02 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-15 15:29 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-12-15 23:04 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-10 7:43 ` Juri Linkov
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874j359d80.fsf@daniel-mendler.de \
--to=bug-gnu-emacs@gnu.org \
--cc=74616@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=juri@linkov.net \
--cc=mail@daniel-mendler.de \
--cc=monnier@iro.umontreal.ca \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).