From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Date: Sun, 15 Dec 2024 16:29:19 +0100 Message-ID: <874j359d80.fsf@daniel-mendler.de> References: <878qt1w7c6.fsf@daniel-mendler.de> <86wmgl9mfz.fsf@gnu.org> <86ldwrirf1.fsf@gnu.org> <87wmgbftih.fsf@daniel-mendler.de> <87jzca2bg5.fsf@daniel-mendler.de> <87wmg8llw1.fsf@mail.linkov.net> <877c88k51i.fsf@daniel-mendler.de> <868qsod3h3.fsf@gnu.org> <87o71kfvgu.fsf@daniel-mendler.de> <86zfl3btx0.fsf@gnu.org> <87ikrqb58x.fsf@daniel-mendler.de> <86ldwiv9mn.fsf@gnu.org> <87pllusd3j.fsf@daniel-mendler.de> <87o71d2xxb.fsf@mail.linkov.net> <87bjxdfemi.fsf@daniel-mendler.de> Reply-To: Daniel Mendler Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4966"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 74616@debbugs.gnu.org, monnier@iro.umontreal.ca To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 15 16:50:16 2024 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 1tMqsp-000159-8l for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Dec 2024 16:50:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMqsj-0005Ji-OD; Sun, 15 Dec 2024 10:50:10 -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 1tMqsf-0005CP-DC for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 10:50:05 -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 1tMqsf-0001mI-38 for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 10:50:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=zdyRd8lyudHjTH7F/SFlDeUmEbkrhrWpEMZaA+6SP50=; b=eFTNHq4sAO3MvBCdg/1cgCqlF5a8oZfK0ZXz3K9f0RX3MONpSZYkTqMCXthaoS8Bws3mk1NCwKJ42PTC6iVxGeMCBInuPi7IsUZU77Zxyc1oiq+w2iNMxXlNVkByrDaFcVGq9BWQlPxvHs3hwTArmKCSElV6q+P+abyzTw0sAuKV24KCNiw3kAs7KVDQl7DzfVxjnhPBD8Bq1vyqxF5xh2dS4fsRPmp5MFqfFBabQdpEcX3ZWInIVnjN8AyAYQZfJrEHYV1G+ZkfBCgbuaBklE0u2ShgLIezG/DyjNHQh7mrgCmoHIzQJoecknCXPO9ajHnS93aM/HZOXAgjexUxVg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMqZG-0003eh-1C for bug-gnu-emacs@gnu.org; Sun, 15 Dec 2024 10:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Dec 2024 15:30:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs Original-Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.173427657313985 (code B ref 74616); Sun, 15 Dec 2024 15:30:01 +0000 Original-Received: (at 74616) by debbugs.gnu.org; 15 Dec 2024 15:29:33 +0000 Original-Received: from localhost ([127.0.0.1]:51644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMqYm-0003dV-TP for submit@debbugs.gnu.org; Sun, 15 Dec 2024 10:29:33 -0500 Original-Received: from server.qxqx.de ([49.12.34.165]:41327 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMqYj-0003d9-5w for 74616@debbugs.gnu.org; Sun, 15 Dec 2024 10:29:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zdyRd8lyudHjTH7F/SFlDeUmEbkrhrWpEMZaA+6SP50=; b=eSyZFYt8bEiRuBELYVw0UWVdpR 7eyuXIAfB6arSAlu4JW2zmIZR70gvKe04MBf7YECPD6gNgVmUXBoBhM/ALeAfy1cPF6aqHoO8lr5j 0i4wD2DCzpIslplgCe8xPrJblbyG+VF+EiC0+gwqUtl5nE0WSy+C3Kg3QGW+Wa0oiDFQ=; In-Reply-To: <87bjxdfemi.fsf@daniel-mendler.de> (Daniel Mendler's message of "Sun, 15 Dec 2024 11:02:29 +0100") 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:297113 Archived-At: --=-=-= Content-Type: text/plain Daniel Mendler writes: > Juri Linkov 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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-completion-eager-display-Use-buffer-content-instead-.patch >From 254c3d7b1ae8224d305aff7f55817c6fd9fca1c5 Mon Sep 17 00:00:00 2001 From: Daniel Mendler 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 --=-=-=--