From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: monnier@iro.umontreal.ca, bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Nov 2024 06:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 74616@debbugs.gnu.org Cc: Stefan Monnier X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: Stefan Monnier Received: via spool by submit@debbugs.gnu.org id=B.173294896019996 (code B ref -1); Sat, 30 Nov 2024 06:43:02 +0000 Received: (at submit) by debbugs.gnu.org; 30 Nov 2024 06:42:40 +0000 Received: from localhost ([127.0.0.1]:45184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHHBg-0005CS-8T for submit@debbugs.gnu.org; Sat, 30 Nov 2024 01:42:40 -0500 Received: from lists.gnu.org ([209.51.188.17]:55206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHHBd-0005CH-Np for submit@debbugs.gnu.org; Sat, 30 Nov 2024 01:42:38 -0500 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 1tHHBd-0007Hr-9p for bug-gnu-emacs@gnu.org; Sat, 30 Nov 2024 01:42:37 -0500 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1] helo=mail.qxqx.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tHHBb-0002w8-Uw for bug-gnu-emacs@gnu.org; Sat, 30 Nov 2024 01:42:37 -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: Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=1KTvNfVKXXFtzGgvwrhIfjqjLxsSmv6cBhX8iCOo6N0=; b=ateYEtE3gN/MeQVvcJvYDDKMt8 edwIP/fBlA6WEBVp+eX9AEwsS14JdwQSYuH4Ywx/uCnxjjk4U+k0bTPEeXmBsTo9LVxnXgtXBDDxs HGRNPokkAMWlQ/KslbYifkD17Q1xIPfqUVkl0Id1bDLqKHqx22S1yuu9WjS/t61YpnFY=; From: Daniel Mendler Date: Sat, 30 Nov 2024 07:42:33 +0100 Message-ID: <878qt1w7c6.fsf@daniel-mendler.de> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a01:4f8:c012:9177::1; envelope-from=mail@daniel-mendler.de; helo=mail.qxqx.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) The `tmm-add-prompt' function of tmm.el automatically displays the *Completions* buffer by calling `minibuffer-completion-help'. If an alternative minibuffer completion system like Icomplete or Vertico is used, the *Completions* buffer is not needed since the candidates are already displayed in the minibuffer. I propose to either detect these alternative completion systems (e.g., by checking the value of the completing-read-function and/or the mode variables) or to provide a new customization variable `tmm-display-completions' which defaults to t but can be set to nil to disable the call to `minibuffer-completion-help'. I am happy to provide a patch for either of these approaches. From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Nov 2024 08:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Daniel Mendler Cc: 74616@debbugs.gnu.org, monnier@iro.umontreal.ca Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.17329538984184 (code B ref 74616); Sat, 30 Nov 2024 08:05:02 +0000 Received: (at 74616) by debbugs.gnu.org; 30 Nov 2024 08:04:58 +0000 Received: from localhost ([127.0.0.1]:45292 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHITK-00015O-5Z for submit@debbugs.gnu.org; Sat, 30 Nov 2024 03:04:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53600) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHITI-00015A-8u for 74616@debbugs.gnu.org; Sat, 30 Nov 2024 03:04:56 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tHITD-0002vT-2H; Sat, 30 Nov 2024 03:04:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=s9U7h9krOiFVsr4aIKZX2ldP+mecFNE+naw2DPIjAtc=; b=SPpFwIj4M2KM OVslqqajUi/lh/y0xborQxF1Xb8kAxILiU9tsabPusYWXx4ahRrtijzoxHEnai1+CRwKbI7KBjR7W pYqJ7toCsgZeGu8gtMQGvdTLp0v3a7JJ38FKaElm50jkcl0TnABlwH4b9F8ZAbazsdbGC9+TpHgvj qZL3sXw/x78Pd1vOwdjMYwLKbbjzfc+67w+kEeM4ReveCpBDlTpAT/U0iZ0T+7A47TRcSzak5Xj9h tE26ODPAbDI7hszSoXOYkv6QKS//C3f/4ySAkaq55ttai25G3bzouVC9q7g77aSF7arUCNli0ARH4 grDH5T2/Gh4+DwqUUpLoVQ==; Date: Sat, 30 Nov 2024 10:04:48 +0200 Message-Id: <86wmgl9mfz.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <878qt1w7c6.fsf@daniel-mendler.de> (bug-gnu-emacs@gnu.org) References: <878qt1w7c6.fsf@daniel-mendler.de> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: Stefan Monnier > Date: Sat, 30 Nov 2024 07:42:33 +0100 > From: Daniel Mendler via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > The `tmm-add-prompt' function of tmm.el automatically displays the > *Completions* buffer by calling `minibuffer-completion-help'. If an > alternative minibuffer completion system like Icomplete or Vertico is > used, the *Completions* buffer is not needed since the candidates are > already displayed in the minibuffer. I propose to either detect these > alternative completion systems (e.g., by checking the value of the > completing-read-function and/or the mode variables) or to provide a new > customization variable `tmm-display-completions' which defaults to t but > can be set to nil to disable the call to `minibuffer-completion-help'. I > am happy to provide a patch for either of these approaches. I think the automatic detection is a better default behavior, but maybe we could have a variable (not necessarily a defcustom) for users who would like to have the old behavior. Stefan, WDYT? From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Nov 2024 08:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 74616@debbugs.gnu.org, monnier@iro.umontreal.ca Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.17329545196486 (code B ref 74616); Sat, 30 Nov 2024 08:16:02 +0000 Received: (at 74616) by debbugs.gnu.org; 30 Nov 2024 08:15:19 +0000 Received: from localhost ([127.0.0.1]:45307 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHIdL-0001gY-EF for submit@debbugs.gnu.org; Sat, 30 Nov 2024 03:15:19 -0500 Received: from server.qxqx.de ([49.12.34.165]:34971 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHIdI-0001bF-MG for 74616@debbugs.gnu.org; Sat, 30 Nov 2024 03:15:17 -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=4De8u3P7+SPKZ/pHnXqbSsTCT0KL/9w3owOFw4kYhg0=; b=ebJ+P57uxbKqJRvqgIwau4CUQk fmfYY0ye1ZvYhMABth+juMjelW3LKFbLzvYjzwm/fTB5nTRmtG0eu6azmYT+Pnmvsv9heawT452Zc gyjD190QskrjNsoKq9WXM4X3lLjQu6df588y2JhvgIdZPvkTtBaHwsZoSELGloUVo3dw=; From: Daniel Mendler In-Reply-To: <86wmgl9mfz.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 30 Nov 2024 10:04:48 +0200") References: <878qt1w7c6.fsf@daniel-mendler.de> <86wmgl9mfz.fsf@gnu.org> Date: Sat, 30 Nov 2024 09:12:57 +0100 Message-ID: <878qt1uol2.fsf@daniel-mendler.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: >> Cc: Stefan Monnier >> Date: Sat, 30 Nov 2024 07:42:33 +0100 >> From: Daniel Mendler via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> The `tmm-add-prompt' function of tmm.el automatically displays the >> *Completions* buffer by calling `minibuffer-completion-help'. If an >> alternative minibuffer completion system like Icomplete or Vertico is >> used, the *Completions* buffer is not needed since the candidates are >> already displayed in the minibuffer. I propose to either detect these >> alternative completion systems (e.g., by checking the value of the >> completing-read-function and/or the mode variables) or to provide a new >> customization variable `tmm-display-completions' which defaults to t but >> can be set to nil to disable the call to `minibuffer-completion-help'. I >> am happy to provide a patch for either of these approaches. > > I think the automatic detection is a better default behavior, but > maybe we could have a variable (not necessarily a defcustom) for users > who would like to have the old behavior. See also what I wrote on my ffap bug report. It may make sense to provide some more general mechanism (auto detection, custom variable, ...) in minibuffer.el which could be used by tmm, ffap and other packages. For example my GNU ELPA package Jinx faces the same problem - if default completion is used, `minibuffer-completion-help' should be called to display the candidates immediately, but not for other completion UIs. > Stefan, WDYT? From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Nov 2024 18:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Daniel Mendler , 74616@debbugs.gnu.org Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.17329929139668 (code B ref 74616); Sat, 30 Nov 2024 18:56:01 +0000 Received: (at 74616) by debbugs.gnu.org; 30 Nov 2024 18:55:13 +0000 Received: from localhost ([127.0.0.1]:49062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHSca-0002Vs-Lh for submit@debbugs.gnu.org; Sat, 30 Nov 2024 13:55:12 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:16693) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHScZ-0002SG-Ks for 74616@debbugs.gnu.org; Sat, 30 Nov 2024 13:55:12 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A4D344427F4; Sat, 30 Nov 2024 13:55:04 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1732992903; bh=81DSlt0Bml/B9KMHC5kCR+HLfojFfTFH6Pn1YaK6QOk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=DIhuG+nZQMo1cI5ZFRx0Ve5NN30d3VspGZcphxBIQL4h2KGGBis/4fmSBwfvg5/PX 38lGbqWUJr5ktgtRmnT38qQqijB4engix/XBOBOMVzF2KsT2447Y2AOAWE2tTUHR67 GvvmwEfBWBKVrUD57J0pxfEXqjYXd2eOlFU78snfewX3aVNkMBNrwQluNgw5rNPQfD 022JVcxB+ppGg7ORSc2Nv+9LV2oUZVdSZUDUFWrtjwhur8ia0+g64ajZ+gyLgTMNEj J7XG0Q0ro3N5YEKE24yXTTGi+SEIARyNCTqkybUhfFrBmpE04eoErgHLr4a2pabRVO vkSO5Hr+TEApw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 35EC9440C1C; Sat, 30 Nov 2024 13:55:03 -0500 (EST) Received: from pastel (104-195-225-43.cpe.teksavvy.com [104.195.225.43]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 04E5E1202B1; Sat, 30 Nov 2024 13:55:02 -0500 (EST) From: Stefan Monnier In-Reply-To: <86wmgl9mfz.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 30 Nov 2024 10:04:48 +0200") Message-ID: References: <878qt1w7c6.fsf@daniel-mendler.de> <86wmgl9mfz.fsf@gnu.org> Date: Sat, 30 Nov 2024 13:55:02 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.002 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > I think the automatic detection is a better default behavior, but > maybe we could have a variable (not necessarily a defcustom) for users > who would like to have the old behavior. > Stefan, WDYT? I often use the standard UI and I generally don't like this eagerness to display *Completions*, so I'd either change the code not to auto-display the buffer (what I have done locally) or at least offer a variable for that. So it seems like the war should have 3 settings: always show, never show, and "guess" (tho maybe we can skip the "guess" option and let the other completion UIs set the var to nil). Stefan From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Dec 2024 04:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Daniel Mendler , 74616@debbugs.gnu.org, Stefan Monnier Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.173302567820253 (code B ref 74616); Sun, 01 Dec 2024 04:02:02 +0000 Received: (at 74616) by debbugs.gnu.org; 1 Dec 2024 04:01:18 +0000 Received: from localhost ([127.0.0.1]:49801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHb93-0005Gb-N2 for submit@debbugs.gnu.org; Sat, 30 Nov 2024 23:01:17 -0500 Received: from sendmail.purelymail.com ([34.202.193.197]:39670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHb91-0005GK-RB for 74616@debbugs.gnu.org; Sat, 30 Nov 2024 23:01:16 -0500 DKIM-Signature: a=rsa-sha256; b=HRQTAXnG9B6kp5ugensZzPOMyiUCpzJ87jVhZ7HCJ8zj8sFpIdDscZGvWSbRLlQjrXni6wcCjFhRc+uP98hkc2phiAZMp6fgT0T0tMlZlKx7/KAxyewbbY8CMjC418xyk+xqzhn7ya5s/24NOQRgjcjDehaQjpggWb+iZFUdnQs318XUZQV7Id0Qv5WHjNky+SnxGRSuJu09NQJSW627ClaYQjsj1M9Yql/d82gouv9qm2p9vMHxc1ZNLCi4blkm7RaJ/QdiDYGHulubDaSquY33MxECxHmFsafivxDLLqNkkjeUVp4k6XH6TRnaeaeKJUvj0qr2e9zTuN8XG5tOjQ==; s=purelymail1; d=spwhitton.name; v=1; bh=vQKksmJvG64H6eclKGxz5TyOcYea94dQNb7cInjWfOI=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=jTaj9Bs0RplwNy9zjYBCn9kgfJDerHtAABqZ/GP+XmNr5jyANRSl/sIXNzA3abPYEIoqq2phxtGRFyK0Z/eaxtcqlQnh4u/1hNifXx+k5JaHmI6zxLaOqCBbYjZFd0xgXaNubrT/Y8vBELq1oSpEIL4o7b6EHBkVDQTKlyJjtwfcCOpe1A1qvZcJmi0HEqxEt/9rZtVFizhClV7SUK2FsN+CYAFawWqKfZI1zYGXR913U6+MWQLlBMTeFCIzuFZPp+bsHc+VhhWG47nrTqNqbMKBTeSbfuHu0ndGOz7hbIvV6D0iPxKCFlqlkdHHkezonIu+gyMJHwcGxJDFDkhcJQ==; s=purelymail1; d=purelymail.com; v=1; bh=vQKksmJvG64H6eclKGxz5TyOcYea94dQNb7cInjWfOI=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 74616@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 929190622; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 01 Dec 2024 04:00:49 +0000 (UTC) Received: by melete.silentflame.com (Postfix, from userid 1000) id EEF507E44F2; Sun, 1 Dec 2024 12:00:45 +0800 (CST) From: Sean Whitton In-Reply-To: (Stefan Monnier via's message of "Sat, 30 Nov 2024 13:55:02 -0500") References: <878qt1w7c6.fsf@daniel-mendler.de> <86wmgl9mfz.fsf@gnu.org> Date: Sun, 01 Dec 2024 12:00:45 +0800 Message-ID: <87h67ouk5u.fsf@melete.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, On Sat 30 Nov 2024 at 01:55pm -05, Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote: > I often use the standard UI and I generally don't like this eagerness to > display *Completions*, so I'd either change the code not to auto-display > the buffer (what I have done locally) or at least offer a variable > for that. "eagerness to display *Completions*" made me think of this NEWS.30 entry which is a stopgap compatibility fix that we'd like to improve: +++ ** The "*Completions*" buffer now always accompanies 'icomplete-in-buffer'. Previously, it was not consistent whether the "*Completions*" buffer would appear when using 'icomplete-in-buffer'. Now the "*Completions*" buffer and Icomplete's in-buffer display of possible completions always appear together. If you would prefer to see only Icomplete's in-buffer display, and not the "*Completions*" buffer, you can add this to your init file: (advice-add 'completion-at-point :after #'minibuffer-hide-completions) Possibly the resolution of this bug could help there, too. -- Sean Whitton From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Dec 2024 12:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: mail@daniel-mendler.de, 74616@debbugs.gnu.org Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.173357612713669 (code B ref 74616); Sat, 07 Dec 2024 12:56:02 +0000 Received: (at 74616) by debbugs.gnu.org; 7 Dec 2024 12:55:27 +0000 Received: from localhost ([127.0.0.1]:45871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tJuLH-0003YO-EZ for submit@debbugs.gnu.org; Sat, 07 Dec 2024 07:55:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tJuLE-0003Xz-El for 74616@debbugs.gnu.org; Sat, 07 Dec 2024 07:55:25 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tJuL5-00069F-Ui; Sat, 07 Dec 2024 07:55:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=/iKdpDIx9hXj7swdUEIHuLDv/AfdXul0YEd+HHsj/Rc=; b=KQh2OLOD4MRt /ab59Jzdt8Y3qCU9FtrXS3w+uRZ9SualAENqUMOjakMdlRwJakGlDP1WZJAX/n/ea8YiOCszy6djp tsjMrRTeu/a1IVb91cBKTCQpuRr2GLf8EIRQ1EIUf6Zd/RDY5SYY8RLgtuUlrOpBL8ILtKaFm9jGX wm2+ggPv2EStOZi2jfm/cI/uW61tTVQjRFsN16DSZDJfzm6jm7CbbZG4C3DqfnXXveFH9te5mEL3d HvH6qlzWEy0KaGzK8ryj9h4eO973UbvvN+B++tiND/x8vzfA6N8T9Kg/0mC9s4o7FKqlDJEqDdvTz Mx/HYCHRYMw5WgKivuBANA==; Date: Sat, 07 Dec 2024 14:55:14 +0200 Message-Id: <86ldwrirf1.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Stefan Monnier on Sat, 30 Nov 2024 13:55:02 -0500) References: <878qt1w7c6.fsf@daniel-mendler.de> <86wmgl9mfz.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: Daniel Mendler , 74616@debbugs.gnu.org > Date: Sat, 30 Nov 2024 13:55:02 -0500 > > > I think the automatic detection is a better default behavior, but > > maybe we could have a variable (not necessarily a defcustom) for users > > who would like to have the old behavior. > > Stefan, WDYT? > > I often use the standard UI and I generally don't like this eagerness to > display *Completions*, so I'd either change the code not to auto-display > the buffer (what I have done locally) or at least offer a variable > for that. > > So it seems like the var should have 3 settings: always show, never > show, and "guess" (tho maybe we can skip the "guess" option and let the > other completion UIs set the var to nil). Daniel, would you like to submit the patch with these changes? From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Dec 2024 14:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 74616@debbugs.gnu.org, Stefan Monnier Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.17335824361971 (code B ref 74616); Sat, 07 Dec 2024 14:41:02 +0000 Received: (at 74616) by debbugs.gnu.org; 7 Dec 2024 14:40:36 +0000 Received: from localhost ([127.0.0.1]:46105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tJvz1-0000Vj-Hi for submit@debbugs.gnu.org; Sat, 07 Dec 2024 09:40:35 -0500 Received: from server.qxqx.de ([49.12.34.165]:54847 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tJvyy-0000VQ-Sx for 74616@debbugs.gnu.org; Sat, 07 Dec 2024 09:40:34 -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=qEwFTbHR5eJ3WCfHjXiCvjAYv/VaVvvVemmz4PQhhO4=; b=wtZrBI8UWMaZuQhdgDkO+mNv1R 5VhVyr/J7ukJZWPZJDGshWxjpNouApr2PHuYq8YLdZ6eCgmAanG+Ipg97KlrNVrF/Eyjr5NoANKcL qR0mubm9I5E6yKMCDRwuGFWQE19riVdEPdnFGdnX5m572Gn7ishCPbfgFAyC7EmFUR6s=; From: Daniel Mendler In-Reply-To: <86ldwrirf1.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 07 Dec 2024 14:55:14 +0200") References: <878qt1w7c6.fsf@daniel-mendler.de> <86wmgl9mfz.fsf@gnu.org> <86ldwrirf1.fsf@gnu.org> Date: Sat, 07 Dec 2024 15:38:14 +0100 Message-ID: <87wmgbftih.fsf@daniel-mendler.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: >> From: Stefan Monnier >> Cc: Daniel Mendler , 74616@debbugs.gnu.org >> Date: Sat, 30 Nov 2024 13:55:02 -0500 >> >> > I think the automatic detection is a better default behavior, but >> > maybe we could have a variable (not necessarily a defcustom) for users >> > who would like to have the old behavior. >> > Stefan, WDYT? >> >> I often use the standard UI and I generally don't like this eagerness to >> display *Completions*, so I'd either change the code not to auto-display >> the buffer (what I have done locally) or at least offer a variable >> for that. >> >> So it seems like the var should have 3 settings: always show, never >> show, and "guess" (tho maybe we can skip the "guess" option and let the >> other completion UIs set the var to nil). > > Daniel, would you like to submit the patch with these changes? So is the plan to add a completion metadata `eager-display' such that completion tables can request immediate display? This completion metadata can then be overridden by the user via `completion-category-overrides'. The patch would include changes to tmm, ffap-menu and imenu (obsoleting `imenu-eager-completion-buffer'). Daniel From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Dec 2024 07:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Daniel Mendler Cc: 74616@debbugs.gnu.org, monnier@iro.umontreal.ca Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.1733642258770 (code B ref 74616); Sun, 08 Dec 2024 07:18:02 +0000 Received: (at 74616) by debbugs.gnu.org; 8 Dec 2024 07:17:38 +0000 Received: from localhost ([127.0.0.1]:49491 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKBXt-0000CM-H2 for submit@debbugs.gnu.org; Sun, 08 Dec 2024 02:17:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKBXq-0000C2-TS for 74616@debbugs.gnu.org; Sun, 08 Dec 2024 02:17:36 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tKBXk-0007jZ-MU; Sun, 08 Dec 2024 02:17:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=608htOpyeHML/YrpDjj9Coz3pV4R59yAtcHqp9VELuM=; b=HRZYaN9bOsY5 MSTHinneqowJnFVvI5jD/XG36W3lSoNq7n7RkZBdvLHczE5Vi6yQZIBcQELadOMAE4RFc6KEdvFbN 8iN4Jt9fWfSKJypNtcWMhJ/0rHV8gEPtzU78Bn32TQ7qwGHdnycoiHe6UXXFcDxFNvsoVDALmmJp1 D8eaeld1RddkEVwDgMxI9yptUBocXcabqRkN7o3GSkqhKPZugGamAbnc4nku453TV8ZvZ1IP3Sp8H iKTuAZMamOqdc/TZOMMa+N3VeVj5g9wCcdCiC+67o3HVG+GcHYLMzScza5+xzUdU67pG94LCsWE/X icXldED1sA3XZCDuWZKnIQ==; Date: Sun, 08 Dec 2024 09:17:26 +0200 Message-Id: <864j3ehce1.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87wmgbftih.fsf@daniel-mendler.de> (message from Daniel Mendler on Sat, 07 Dec 2024 15:38:14 +0100) References: <878qt1w7c6.fsf@daniel-mendler.de> <86wmgl9mfz.fsf@gnu.org> <86ldwrirf1.fsf@gnu.org> <87wmgbftih.fsf@daniel-mendler.de> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Daniel Mendler > Cc: Stefan Monnier , 74616@debbugs.gnu.org > Date: Sat, 07 Dec 2024 15:38:14 +0100 > > Eli Zaretskii writes: > > >> From: Stefan Monnier > >> Cc: Daniel Mendler , 74616@debbugs.gnu.org > >> Date: Sat, 30 Nov 2024 13:55:02 -0500 > >> > >> > I think the automatic detection is a better default behavior, but > >> > maybe we could have a variable (not necessarily a defcustom) for users > >> > who would like to have the old behavior. > >> > Stefan, WDYT? > >> > >> I often use the standard UI and I generally don't like this eagerness to > >> display *Completions*, so I'd either change the code not to auto-display > >> the buffer (what I have done locally) or at least offer a variable > >> for that. > >> > >> So it seems like the var should have 3 settings: always show, never > >> show, and "guess" (tho maybe we can skip the "guess" option and let the > >> other completion UIs set the var to nil). > > > > Daniel, would you like to submit the patch with these changes? > > So is the plan to add a completion metadata `eager-display' such that > completion tables can request immediate display? This completion > metadata can then be overridden by the user via > `completion-category-overrides'. The patch would include changes to tmm, > ffap-menu and imenu (obsoleting `imenu-eager-completion-buffer'). AFAIU, both Stefan and myself only commented on the more specific change you suggested originally, not the more general one you described in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74616#11 From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Dec 2024 07:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 74616@debbugs.gnu.org, monnier@iro.umontreal.ca Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.17336441546638 (code B ref 74616); Sun, 08 Dec 2024 07:50:01 +0000 Received: (at 74616) by debbugs.gnu.org; 8 Dec 2024 07:49:14 +0000 Received: from localhost ([127.0.0.1]:49538 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKC2T-0001j0-RT for submit@debbugs.gnu.org; Sun, 08 Dec 2024 02:49:14 -0500 Received: from server.qxqx.de ([49.12.34.165]:54337 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKC2R-0001iT-7N for 74616@debbugs.gnu.org; Sun, 08 Dec 2024 02:49:12 -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=nXJWMsidyx1Viqw2wAQdSyMRaMyHebe2ZJ5M+MOadDw=; b=DljBFDtazdYGz7i8vuEtLfoynj 5hi84OvsDZxL7OEBe1X2X9EFTlzzGfcKWuNBvPTDjOcDE5/CZqQvW9jEHuuj4boUM1bmN76+YsOij 9FrRifrLLNQcpfKUo0g4kLDhysweVH+qQaz3173AhByo2n9FXXtknAN15oYkwu8G9PoE=; From: Daniel Mendler In-Reply-To: <864j3ehce1.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 08 Dec 2024 09:17:26 +0200") References: <878qt1w7c6.fsf@daniel-mendler.de> <86wmgl9mfz.fsf@gnu.org> <86ldwrirf1.fsf@gnu.org> <87wmgbftih.fsf@daniel-mendler.de> <864j3ehce1.fsf@gnu.org> Date: Sun, 08 Dec 2024 08:49:02 +0100 Message-ID: <878qsqbonl.fsf@daniel-mendler.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: >> From: Daniel Mendler >> Cc: Stefan Monnier , 74616@debbugs.gnu.org >> Date: Sat, 07 Dec 2024 15:38:14 +0100 >> >> Eli Zaretskii writes: >> >> >> From: Stefan Monnier >> >> Cc: Daniel Mendler , 74616@debbugs.gnu.org >> >> Date: Sat, 30 Nov 2024 13:55:02 -0500 >> >> >> >> > I think the automatic detection is a better default behavior, but >> >> > maybe we could have a variable (not necessarily a defcustom) for users >> >> > who would like to have the old behavior. >> >> > Stefan, WDYT? >> >> >> >> I often use the standard UI and I generally don't like this eagerness to >> >> display *Completions*, so I'd either change the code not to auto-display >> >> the buffer (what I have done locally) or at least offer a variable >> >> for that. >> >> >> >> So it seems like the var should have 3 settings: always show, never >> >> show, and "guess" (tho maybe we can skip the "guess" option and let the >> >> other completion UIs set the var to nil). >> > >> > Daniel, would you like to submit the patch with these changes? >> >> So is the plan to add a completion metadata `eager-display' such that >> completion tables can request immediate display? This completion >> metadata can then be overridden by the user via >> `completion-category-overrides'. The patch would include changes to tmm, >> ffap-menu and imenu (obsoleting `imenu-eager-completion-buffer'). > > AFAIU, both Stefan and myself only commented on the more specific > change you suggested originally, not the more general one you > described in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74616#11 Okay, I see. Is there interest in a general solution for all the scenarios, instead of replicating customization variables multiple times? Then users like Stefan who don't like the eager display, or completion UIs would only have to customize a single variable once. If a customization variable is preferred over the completion metadata, one could add a `minibuffer-eager-completion-help-function function to minibuffer.el (please make suggestions for a better name): (defcustom minibuffer-eager-completion-help-function #'minibuffer-completion-help "Can be set to `minibuffer-completion-help' to show the eager display, to `ignore' to disable the eager display, or to a custom function which performs auto detection." ...) It would be used like this at the call sites (imenu, ffap, tmm): (minibuffer-with-setup-hook minibuffer-eager-completion-help-function (completing-read ...)) Daniel From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Dec 2024 15:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Daniel Mendler Cc: Eli Zaretskii , 74616@debbugs.gnu.org Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.173367204329477 (code B ref 74616); Sun, 08 Dec 2024 15:35:01 +0000 Received: (at 74616) by debbugs.gnu.org; 8 Dec 2024 15:34:03 +0000 Received: from localhost ([127.0.0.1]:51415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKJIJ-0007fN-E5 for submit@debbugs.gnu.org; Sun, 08 Dec 2024 10:34:03 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:12342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKJIH-0007ek-A9 for 74616@debbugs.gnu.org; Sun, 08 Dec 2024 10:34:01 -0500 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 329CF8093D; Sun, 8 Dec 2024 10:33:55 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1733672034; bh=94jOie+s8mCBrYPsi9dGYOKAumoyyANb4j6Chy6GcDY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=nlm3rCCUBTWXW3wXr0Nk+QLxQ18qqITjsG+M78opw/pzzAunrps5qWVl7l3Q7pRvE 5izxS6S5/KGbC3yEam4JIZLD3zMGYbXtoFWJtGkkRgpGOkE+RHWpfzngmSnXKWIZy9 91veM55GLhRyIX78KFH8SHgAU40+FtKzMopLs0UYHCbDoTXA9BDl6APozbxqKAlUwJ 9q8yhDGHUuBEEDRAIjH8J7fftWcwAryFjhgm4GsweAotqk8c2ogS2GpJsppV/oYjVq m7wgt46L3q9e5cUc8r8il6vF6MQ8QGNMEI4grenbGRXI6/GEqFuQs+nqbmT19iGFKJ xnPt6MnKwGWNw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5952980013; Sun, 8 Dec 2024 10:33:54 -0500 (EST) Received: from pastel (104-195-225-43.cpe.teksavvy.com [104.195.225.43]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 297F71206AC; Sun, 8 Dec 2024 10:33:54 -0500 (EST) From: Stefan Monnier In-Reply-To: <87wmgbftih.fsf@daniel-mendler.de> (Daniel Mendler's message of "Sat, 07 Dec 2024 15:38:14 +0100") Message-ID: References: <878qt1w7c6.fsf@daniel-mendler.de> <86wmgl9mfz.fsf@gnu.org> <86ldwrirf1.fsf@gnu.org> <87wmgbftih.fsf@daniel-mendler.de> Date: Sun, 08 Dec 2024 10:33:53 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.044 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > So is the plan to add a completion metadata `eager-display' such that > completion tables can request immediate display? This completion > metadata can then be overridden by the user via > `completion-category-overrides'. The patch would include changes to tmm, > ffap-menu and imenu (obsoleting `imenu-eager-completion-buffer'). That sounds good, except that in order for `completion-category-overrides` to work reliably, the `eager-display` should not be in the metadata but in `completion-category-defaults`. Stefan From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Dec 2024 20:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Eli Zaretskii , 74616@debbugs.gnu.org, Juri Linkov Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.173368809015452 (code B ref 74616); Sun, 08 Dec 2024 20:02:02 +0000 Received: (at 74616) by debbugs.gnu.org; 8 Dec 2024 20:01:30 +0000 Received: from localhost ([127.0.0.1]:51767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKNT7-000419-D0 for submit@debbugs.gnu.org; Sun, 08 Dec 2024 15:01:30 -0500 Received: from server.qxqx.de ([49.12.34.165]:45245 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKNT5-00040n-7M for 74616@debbugs.gnu.org; Sun, 08 Dec 2024 15:01:28 -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=AAlNUTBPzt+qV8kqrjFJFHnh0n7AufhM/GXBXuQpzBw=; b=AR3o/i2WHdLBQ7xbFpAY0aNlit i7TGR66R9BtrdUL8JDZbKsIrrr8A7rHflHoYWLiP+IkP+LsBh6ul6KYHxjvEZ+uVCJ1cBNidI7Ao6 gKjibvcN/TJsew4dmul2yA3ta0k+mdOiGb+hq6IhzTNXHwDXcR2UUOehBM34ISAd5QHc=; From: Daniel Mendler In-Reply-To: (Stefan Monnier's message of "Sun, 08 Dec 2024 10:33:53 -0500") References: <878qt1w7c6.fsf@daniel-mendler.de> <86wmgl9mfz.fsf@gnu.org> <86ldwrirf1.fsf@gnu.org> <87wmgbftih.fsf@daniel-mendler.de> Date: Sun, 08 Dec 2024 20:59:06 +0100 Message-ID: <87jzca2bg5.fsf@daniel-mendler.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Stefan Monnier writes: >> So is the plan to add a completion metadata `eager-display' such that >> completion tables can request immediate display? This completion >> metadata can then be overridden by the user via >> `completion-category-overrides'. The patch would include changes to tmm, >> ffap-menu and imenu (obsoleting `imenu-eager-completion-buffer'). > > That sounds good, except that in order for > `completion-category-overrides` to work reliably, the `eager-display` > should not be in the metadata but in `completion-category-defaults`. Okay. Can you please clarify why you assume that overriding isn't reliably possible if the metadata is specified directly? In `completion-metadata-get' the `completion-category-defaults' and `completion-category-overrides' take precedence over the completion table metadata. I attached a patch which adds a customization option `completion-eager-display' and an `eager-display' completion table metadata. The customization option can be set to nil (never), t (always) or to auto, which means that the *Completions* buffer will only be shown if the completion table requests eager display via the `eager-display' metadata. I updated ffap.el, tmm.el and imenu.el to take advantage of the new `eager-display' metadata. I added completion categories where missing such that overriding the metadata becomes possible. If desired, the metadata can be moved to `completion-category-defaults' instead. Daniel --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-New-customization-variable-completion-eager-display.patch >From 2a4f2c04a880c6a66207a0717f5ba79bbfe109ef Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Sun, 8 Dec 2024 20:05:07 +0100 Subject: [PATCH] New customization variable `completion-eager-display' The customization option can be set to t or nil, to respectively always or never show the *Completions* buffer eagerly at the beginning of a completion session. Furthermore the option can be set to the value auto. In this case the *Completions* buffer will only be shown if requested by the completion table. Completion tables can use the `eager-display' completion metadata to do so. * lisp/minibuffer.el (completion-eager-display): New customization variable. (completion-metadata): Update docstring, document the new `eager-display' completion metadata. (completion-extra-properties): Update docstring, document the new `:eager-display' completion metadata. (completing-read-default): Handle the `completion-eager-display' customization variable and the `eager-display' completion metadata. (completion-table-with-metadata): New function to create a completion table with metadata. (minibuffer-complete-defaults, minibuffer-complete-history): Use it. * lisp/ffap.el (ffap-menu-ask): Add `ffap-menu' completion category and `eager-display' completion metadata. Use `completion-table-with-metadata'. * lisp/imenu.el (imenu-eager-completion-buffer): Correct docstring, which had been inverted. (imenu--completion-buffer): Add `eager-display' completion metadata. Use `completion-table-with-metadata'. * lisp/tmm.el (tmm-prompt): Add `tmm' completion category and `eager-display' completion metadata. Use `completion-table-with-metadata'. (tmm-goto-completions): Ensure that a *Completions* buffer is available. (tmm--completion-table): Remove unused internal function. --- lisp/ffap.el | 17 ++++++++------- lisp/imenu.el | 40 ++++++++++++++++------------------ lisp/minibuffer.el | 54 ++++++++++++++++++++++++++++++++++++---------- lisp/tmm.el | 38 ++++++++++++++++---------------- 4 files changed, 90 insertions(+), 59 deletions(-) diff --git a/lisp/ffap.el b/lisp/ffap.el index 6a4915fb5a3..c869e234140 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1738,14 +1738,15 @@ ffap-menu-ask alist)))))) ;; minibuffer with completion buffer: (t - (let ((minibuffer-setup-hook 'minibuffer-completion-help)) - ;; Bug: prompting may assume unique strings, no "". - (setq choice - (completing-read - (format-prompt title (car (car alist))) - alist nil t - ;; (cons (car (car alist)) 0) - nil))) + ;; Bug: prompting may assume unique strings, no "". + (setq choice + (completing-read + (format-prompt title (car (car alist))) + (completion-table-with-metadata + alist '((category . ffap-menu) (eager-display . t))) + nil t + ;; (cons (car (car alist)) 0) + nil)) (sit-for 0) ; redraw original screen ;; Convert string to its entry, or else the default: (setq choice (or (assoc choice alist) (car alist))))) diff --git a/lisp/imenu.el b/lisp/imenu.el index 2d64970bfcf..ba1ba5fcd00 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -100,7 +100,7 @@ imenu-use-popup-menu (other :tag "Always" t))) (defcustom imenu-eager-completion-buffer t - "If non-nil, eagerly pop up the completion buffer." + "If nil, eagerly pop up the completion buffer." :type 'boolean :version "22.1") @@ -767,27 +767,25 @@ imenu--completion-buffer (imenu--in-alist name prepared-index-alist) ;; Default to `name' if it's in the alist. name)))) - ;; Display the completion buffer. (minibuffer-with-setup-hook - (lambda () - (setq-local minibuffer-allow-text-properties t) - (setq-local completion-extra-properties - `( :category imenu - ,@(when (eq imenu-flatten 'annotation) - `(:annotation-function - ,(lambda (s) (get-text-property - 0 'imenu-section s)))) - ,@(when (eq imenu-flatten 'group) - `(:group-function - ,(lambda (s transform) - (if transform s - (get-text-property - 0 'imenu-section s))))))) - (unless imenu-eager-completion-buffer - (minibuffer-completion-help))) - (setq name (completing-read prompt - prepared-index-alist - nil t nil 'imenu--history-list name))) + (lambda () (setq-local minibuffer-allow-text-properties t)) + (setq name (completing-read + prompt + (completion-table-with-metadata + prepared-index-alist + `((category . imenu) + (eager-display . ,(not imenu-eager-completion-buffer)) + ,@(when (eq imenu-flatten 'annotation) + `((annotation-function + . ,(lambda (s) (get-text-property + 0 'imenu-section s))))) + ,@(when (eq imenu-flatten 'group) + `((group-function + . ,(lambda (s transform) + (if transform s + (get-text-property + 0 'imenu-section s)))))))) + nil t nil 'imenu--history-list name))) (when (stringp name) (or (get-text-property 0 'imenu-choice name) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 405ee21cdb2..1dfe450a35c 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -138,6 +138,9 @@ completion-metadata of completions. Can operate destructively. - `cycle-sort-function': function to sort entries when cycling. Works like `display-sort-function'. +- `eager-display': non-nil to request eager display of the + completion candidates. Can also be a function which is invoked + after minibuffer setup. The metadata of a completion table should be constant between two boundaries." (let ((metadata (if (functionp table) (funcall table string pred 'metadata)))) @@ -277,6 +280,15 @@ completion-table-case-fold (let ((completion-ignore-case (not dont-fold))) (complete-with-action action table string pred)))) +(defun completion-table-with-metadata (table metadata) + "Return new completion TABLE with METADATA. +METADATA should be an alist of completion metadata. See +`completion-metadata' for a list of supported metadata." + (lambda (string pred action) + (if (eq action 'metadata) + `(metadata . ,metadata) + (complete-with-action action table string pred)))) + (defun completion-table-subvert (table s1 s2) "Return a completion table from TABLE with S1 replaced by S2. The result is a completion table which completes strings of the @@ -1031,6 +1043,18 @@ minibuffer--completion-prompt-end (defvar completion-show-inline-help t "If non-nil, print helpful inline messages during completion.") +(defcustom completion-eager-display 'auto + "Display the *Completions* buffer eagerly. + +If the variable is set to t or nil, respectively show the *Completions* +buffer always or never eagerly. The value `auto' shows the +*Completions* buffer eagerly only if requested by the completion +command. Completion tables can request eager display via the +`eager-display' metadata." + :type '(choice (const :tag "Never show *Completions* eagerly" nil) + (const :tag "Always show *Completions* eagerly" t) + (const :tag "If requested by the completion command" auto))) + (defcustom completion-auto-help t "Non-nil means automatically provide help for invalid completion input. If the value is t, the *Completions* buffer is displayed whenever completion @@ -2493,6 +2517,8 @@ completion-extra-properties `:cycle-sort-function': Function to sort entries when cycling. +`:eager-display': Show the *Completions* buffer eagerly. + See more information about these functions above in `completion-metadata'. @@ -4809,7 +4835,17 @@ completing-read-default (setq-local minibuffer--require-match require-match) (setq-local minibuffer--original-buffer buffer) ;; Copy the value from original buffer to the minibuffer. - (setq-local completion-ignore-case c-i-c)) + (setq-local completion-ignore-case c-i-c) + ;; Show the completion help eagerly if + ;; `completion-eager-display' is t or if eager display + ;; has been requested by the completion table. + (when completion-eager-display + (let* ((md (completion-metadata + initial-input collection predicate)) + (fun (completion-metadata-get md 'eager-display))) + (when (or fun (eq completion-eager-display t)) + (funcall (if (functionp fun) + fun #'minibuffer-completion-help)))))) (read-from-minibuffer prompt initial-input keymap nil hist def inherit-input-method)))) (when (and (equal result "") def) @@ -4999,11 +5035,9 @@ minibuffer-complete-history (lambda () (get-buffer-window "*Completions*" 0)))) (completion-in-region (minibuffer--completion-prompt-end) (point-max) - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (display-sort-function . identity) - (cycle-sort-function . identity)) - (complete-with-action action completions string pred))))))) + (completion-table-with-metadata + completions '((display-sort-function . identity) + (cycle-sort-function . identity))))))) (defun minibuffer-complete-defaults () "Complete minibuffer defaults as far as possible. @@ -5019,11 +5053,9 @@ minibuffer-complete-defaults (lambda () (get-buffer-window "*Completions*" 0)))) (completion-in-region (minibuffer--completion-prompt-end) (point-max) - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (display-sort-function . identity) - (cycle-sort-function . identity)) - (complete-with-action action completions string pred)))))) + (completion-table-with-metadata + completions '((display-sort-function . identity) + (cycle-sort-function . identity)))))) (define-key minibuffer-local-map [?\C-x up] 'minibuffer-complete-history) (define-key minibuffer-local-map [?\C-x down] 'minibuffer-complete-defaults) diff --git a/lisp/tmm.el b/lisp/tmm.el index 632e55e47a8..01912916a6d 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el @@ -119,12 +119,6 @@ tmm-inactive '((t :inherit shadow)) "Face used for inactive menu items.") -(defun tmm--completion-table (items) - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (display-sort-function . identity)) - (complete-with-action action items string pred)))) - (defvar tmm--history nil) ;;;###autoload @@ -222,19 +216,23 @@ tmm-prompt (setq out (if default-item (car (nth index-of-default tmm-km-list)) - (minibuffer-with-setup-hook #'tmm-add-prompt - ;; tmm-km-list is reversed, because history - ;; needs it in LIFO order. But default list - ;; needs it in non-reverse order, so that the - ;; menu items are displayed by M-n as default - ;; values in the order they are shown on - ;; the menu bar. So pass the DEFAULT arg the - ;; reversed copy of the list. - (completing-read-default - (concat gl-str - " (up/down to change, PgUp to menu): ") - (tmm--completion-table tmm-km-list) nil t nil - 'tmm--history (reverse tmm--history))))))) + ;; tmm-km-list is reversed, because history + ;; needs it in LIFO order. But default list + ;; needs it in non-reverse order, so that the + ;; menu items are displayed by M-n as default + ;; values in the order they are shown on + ;; the menu bar. So pass the DEFAULT arg the + ;; reversed copy of the list. + (completing-read-default + (concat gl-str + " (up/down to change, PgUp to menu): ") + (completion-table-with-metadata + tmm-km-list '((category . tmm) + (eager-display . tmm-add-prompt) + (display-sort-function . identity) + (cycle-sort-function . identity))) + nil t nil + 'tmm--history (reverse tmm--history)))))) (if (and (stringp out) (string= "^" out)) ;; A fake choice to please the destructuring later. (setq choice (cons out out)) @@ -458,6 +456,8 @@ tmm-shortcut (defun tmm-goto-completions () "Jump to the completions buffer." (interactive) + (unless (get-buffer "*Completions*") + (minibuffer-completion-help)) (setq tmm-c-prompt (buffer-substring (minibuffer-prompt-end) (point-max))) ;; Clear minibuffer old contents before using *Completions* buffer for ;; selection. -- 2.45.2 --=-=-=-- From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Dec 2024 14:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Daniel Mendler Cc: Eli Zaretskii , 74616@debbugs.gnu.org, Juri Linkov Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.173375400026537 (code B ref 74616); Mon, 09 Dec 2024 14:20:02 +0000 Received: (at 74616) by debbugs.gnu.org; 9 Dec 2024 14:20:00 +0000 Received: from localhost ([127.0.0.1]:53344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKec7-0006tm-7w for submit@debbugs.gnu.org; Mon, 09 Dec 2024 09:20:00 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:49813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKec4-0006tP-3Y for 74616@debbugs.gnu.org; Mon, 09 Dec 2024 09:19:54 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id F00EB100042; Mon, 9 Dec 2024 09:19:45 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1733753985; bh=hgeGRG69VIL9pvSDVSrq0kFj4Imz6xMLd52+OKPcj5I=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=JKHS/StRwhes9yqQdV3iRTdZZcYPlmO6vrWUfSmfodOOpA14ZJsZzc8fDf/ZuaPMN KLtutSajUgQAr8d/SlwGbg/hTaRD8vhROvx5R07yBhyeamRibg9eqvGwZqvN9q0HAP 4KAzJCr2F8pBIVJ+dqU6MQSAls/1pXLF8yCiFPUr4TydnJjR0YSHDCLvYE0UTwRJuq C6kcpXlwNZ/7DDFdXgTf/Y3vv17Xls/9o6bkpLQg/OvJoGLgSQ7jxJ2wc7QyFyyDl0 8mhid94nFQBOSS/eWrZMRdh6JAufJaTqae6BHxk1F1pKwL87HfAqLulevYEqjxFj45 Mf+Mw9i/uTSbw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 57C04100126; Mon, 9 Dec 2024 09:19:45 -0500 (EST) Received: from pastel (104-195-225-43.cpe.teksavvy.com [104.195.225.43]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 262E1120644; Mon, 9 Dec 2024 09:19:45 -0500 (EST) From: Stefan Monnier In-Reply-To: <87jzca2bg5.fsf@daniel-mendler.de> (Daniel Mendler's message of "Sun, 08 Dec 2024 20:59:06 +0100") Message-ID: References: <878qt1w7c6.fsf@daniel-mendler.de> <86wmgl9mfz.fsf@gnu.org> <86ldwrirf1.fsf@gnu.org> <87wmgbftih.fsf@daniel-mendler.de> <87jzca2bg5.fsf@daniel-mendler.de> Date: Mon, 09 Dec 2024 09:19:44 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.024 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Okay. Can you please clarify why you assume that overriding isn't > reliably possible if the metadata is specified directly? Because `completion-category-overrides` works only if there's an appropriate `category` to use. If the `eager-display` info comes straight from the metadata, there's no guarantee that there's an associated `category` info that can be used. Stefan From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Dec 2024 14:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Eli Zaretskii , 74616@debbugs.gnu.org, Juri Linkov Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.1733755592494 (code B ref 74616); Mon, 09 Dec 2024 14:47:01 +0000 Received: (at 74616) by debbugs.gnu.org; 9 Dec 2024 14:46:32 +0000 Received: from localhost ([127.0.0.1]:53402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKf1r-00007u-Km for submit@debbugs.gnu.org; Mon, 09 Dec 2024 09:46:31 -0500 Received: from server.qxqx.de ([49.12.34.165]:57869 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKf1o-00007I-Kd for 74616@debbugs.gnu.org; Mon, 09 Dec 2024 09:46:29 -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=MUICSJ6YQD9MCNPmoxtC5APxBnSUX+IpwlkitxHKf44=; b=CiwpmkFbG14wZ6OXNGyNQvGoA+ nq2D13S8BjNOGOVCU0w6/EWTkdYNgx0j4oQkYQZxT1h8fIw/ARWd9rrQmBwDpMLQrOpeD0At4hTL9 l80iIz4i6h/zHy3izlTWAeFu/pUnD0Gjj4aJrVY0SejvrU5TYw0rWXMt7xmHYNubEKxg=; From: Daniel Mendler In-Reply-To: (Stefan Monnier's message of "Mon, 09 Dec 2024 09:19:44 -0500") References: <878qt1w7c6.fsf@daniel-mendler.de> <86wmgl9mfz.fsf@gnu.org> <86ldwrirf1.fsf@gnu.org> <87wmgbftih.fsf@daniel-mendler.de> <87jzca2bg5.fsf@daniel-mendler.de> Date: Mon, 09 Dec 2024 15:44:08 +0100 Message-ID: <875xnslxvr.fsf@daniel-mendler.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Stefan Monnier writes: >> Okay. Can you please clarify why you assume that overriding isn't >> reliably possible if the metadata is specified directly? > > Because `completion-category-overrides` works only if there's an > appropriate `category` to use. If the `eager-display` info comes > straight from the metadata, there's no guarantee that there's > an associated `category` info that can be used. I've added both completion categories and eager-display. Please see the attached patch. As soon as there is a completion category, overriding will work. While the completion category is a necessary prerequisite to support overriding, adding eager-display at either places should do. Also note the addition of the completion-eager-display defcustom (with values nil, t, auto), which will make it much easier to turn off eager display globally. Daniel From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Dec 2024 15:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Daniel Mendler Cc: 74616@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.173375797910772 (code B ref 74616); Mon, 09 Dec 2024 15:27:02 +0000 Received: (at 74616) by debbugs.gnu.org; 9 Dec 2024 15:26:19 +0000 Received: from localhost ([127.0.0.1]:55196 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKfeM-0002ng-TN for submit@debbugs.gnu.org; Mon, 09 Dec 2024 10:26:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47236) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKfeJ-0002n9-3j for 74616@debbugs.gnu.org; Mon, 09 Dec 2024 10:26:16 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tKfeA-0004i7-Dk; Mon, 09 Dec 2024 10:26:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=BUv6g3rANAuNlwU+kTplqFeDTbyADhtXQyW0DA20NfY=; b=TCADjOxm4Eep IexEGgT+rLT/ORNpQpbEwC7lkf8q48cfxAiFRmciGhLEwPe38vTIKvAvNr6n5IzhIQyU0/CIeGSqr X5ZcBiflHIPcWvWkG7S/gt4hRdb7j9Cv5GYxZWOMHDEHuhVQHaeBpbcPQAqknbDClNsg29RyNeFDk 908N+Ggm4ui5s7neOef9IebDGo+VdDn7+3eHmBIpI8FOdPg1UNy+uMXcqD673zxMK22PbUGFETCYI IIy5hKcOtuNaZWLRHlN2MgxkwlS0sUMyoSfXFJCtzBO10CVl/sk0UrrGmYnSIzdm0MCFOcoo6sT4D IMzI2zzfNYH/CSySYwT4Dg==; Date: Mon, 09 Dec 2024 17:25:53 +0200 Message-Id: <86ldwodgji.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <875xnslxvr.fsf@daniel-mendler.de> (message from Daniel Mendler on Mon, 09 Dec 2024 15:44:08 +0100) References: <878qt1w7c6.fsf@daniel-mendler.de> <86wmgl9mfz.fsf@gnu.org> <86ldwrirf1.fsf@gnu.org> <87wmgbftih.fsf@daniel-mendler.de> <87jzca2bg5.fsf@daniel-mendler.de> <875xnslxvr.fsf@daniel-mendler.de> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Daniel Mendler > Cc: Eli Zaretskii , 74616@debbugs.gnu.org, Juri Linkov > > Date: Mon, 09 Dec 2024 15:44:08 +0100 > > Stefan Monnier writes: > > >> Okay. Can you please clarify why you assume that overriding isn't > >> reliably possible if the metadata is specified directly? > > > > Because `completion-category-overrides` works only if there's an > > appropriate `category` to use. If the `eager-display` info comes > > straight from the metadata, there's no guarantee that there's > > an associated `category` info that can be used. > > I've added both completion categories and eager-display. Please see the > attached patch. ENOPATCH From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Dec 2024 15:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 74616@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.173375895514605 (code B ref 74616); Mon, 09 Dec 2024 15:43:02 +0000 Received: (at 74616) by debbugs.gnu.org; 9 Dec 2024 15:42:35 +0000 Received: from localhost ([127.0.0.1]:55233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKfu7-0003nV-7O for submit@debbugs.gnu.org; Mon, 09 Dec 2024 10:42:35 -0500 Received: from server.qxqx.de ([49.12.34.165]:52845 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKfu4-0003n7-RC for 74616@debbugs.gnu.org; Mon, 09 Dec 2024 10:42:33 -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=iDH0/z8+e20eru8NryWLg26quY/SEKvJnFpdV1eUdT8=; b=ua0WVRRMUDKwJmCkKB6Dstl7Gy 9soDZqPf2gb24WfMW2a0MGwu+okDL/e4U7LlAnFR3C3iuUSUN6V83c0Rys0sF1r2GUnGuaq4kTjRb boiD+x98ULUo9XoG4vd1+d1usRh2hAWHUGVcQqTGMUaPlsmgIZKHd5kJiLRwlLGHsnE0=; From: Daniel Mendler In-Reply-To: <86ldwodgji.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 09 Dec 2024 17:25:53 +0200") References: <878qt1w7c6.fsf@daniel-mendler.de> <86wmgl9mfz.fsf@gnu.org> <86ldwrirf1.fsf@gnu.org> <87wmgbftih.fsf@daniel-mendler.de> <87jzca2bg5.fsf@daniel-mendler.de> <875xnslxvr.fsf@daniel-mendler.de> <86ldwodgji.fsf@gnu.org> Date: Mon, 09 Dec 2024 16:42:23 +0100 Message-ID: <87jzc8rhgg.fsf@daniel-mendler.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: >> From: Daniel Mendler >> Cc: Eli Zaretskii , 74616@debbugs.gnu.org, Juri Linkov >> >> Date: Mon, 09 Dec 2024 15:44:08 +0100 >> >> Stefan Monnier writes: >> >> >> Okay. Can you please clarify why you assume that overriding isn't >> >> reliably possible if the metadata is specified directly? >> > >> > Because `completion-category-overrides` works only if there's an >> > appropriate `category` to use. If the `eager-display` info comes >> > straight from the metadata, there's no guarantee that there's >> > an associated `category` info that can be used. >> >> I've added both completion categories and eager-display. Please see the >> attached patch. > > ENOPATCH https://debbugs.gnu.org/cgi/bugreport.cgi?msg=35;bug=74616 From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Dec 2024 19:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Daniel Mendler Cc: Eli Zaretskii , 74616@debbugs.gnu.org, Stefan Monnier Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.173377115128530 (code B ref 74616); Mon, 09 Dec 2024 19:06:02 +0000 Received: (at 74616) by debbugs.gnu.org; 9 Dec 2024 19:05:51 +0000 Received: from localhost ([127.0.0.1]:55659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKj4p-0007Q6-75 for submit@debbugs.gnu.org; Mon, 09 Dec 2024 14:05:51 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:49485) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKj4m-0007Pr-Q4 for 74616@debbugs.gnu.org; Mon, 09 Dec 2024 14:05:49 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id B9BBFFF802; Mon, 9 Dec 2024 19:05:20 +0000 (UTC) From: Juri Linkov In-Reply-To: <87jzca2bg5.fsf@daniel-mendler.de> (Daniel Mendler's message of "Sun, 08 Dec 2024 20:59:06 +0100") Organization: LINKOV.NET References: <878qt1w7c6.fsf@daniel-mendler.de> <86wmgl9mfz.fsf@gnu.org> <86ldwrirf1.fsf@gnu.org> <87wmgbftih.fsf@daniel-mendler.de> <87jzca2bg5.fsf@daniel-mendler.de> Date: Mon, 09 Dec 2024 21:03:10 +0200 Message-ID: <87wmg8llw1.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > I attached a patch which adds a customization option > `completion-eager-display' and an `eager-display' completion table > metadata. The customization option can be set to nil (never), t (always) > or to auto, which means that the *Completions* buffer will only be shown > if the completion table requests eager display via the `eager-display' > metadata. > > I updated ffap.el, tmm.el and imenu.el to take advantage of the new > `eager-display' metadata. I added completion categories where missing > such that overriding the metadata becomes possible. If desired, the > metadata can be moved to `completion-category-defaults' instead. Thanks, I tested everything, and it works nicely. One small detail that could be added later is to extend the customization type of `completion-category-overrides' :value-type with `eager-display'. Since currently only programmatic use is supported. Also tried to do: (add-to-list 'completion-category-overrides '(tmm (eager-display . nil))) but after typing TAB it pops up the completion buffer where all functionality is lost. Is this because `tmm-add-prompt' is called only for non-nil `eager-display'? From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Dec 2024 19:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: Eli Zaretskii , 74616@debbugs.gnu.org, Stefan Monnier Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.173377249832760 (code B ref 74616); Mon, 09 Dec 2024 19:29:02 +0000 Received: (at 74616) by debbugs.gnu.org; 9 Dec 2024 19:28:18 +0000 Received: from localhost ([127.0.0.1]:55693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjQX-0008WK-Vc for submit@debbugs.gnu.org; Mon, 09 Dec 2024 14:28:18 -0500 Received: from server.qxqx.de ([49.12.34.165]:42825 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjQW-0008Vy-2F for 74616@debbugs.gnu.org; Mon, 09 Dec 2024 14:28:17 -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=/lD4AlDGWUw9wrqxnyanATdF3Ovk14ZzLXEQ91kGofc=; b=L59+wuCGvsjxkWuEoMXOr04RGa L5XWiXC25eI+XZ/LXDpv/mis0v78Ie5W5Eq5o1tzTLO7KLA8J7YWwF+lmVUX+WnBnjlsnPy0bV1s8 GzvszTwS3KSuUbxn02BRrmdg7DLju2laqqlDTpH6E+t2YCqqbYyUUqOXJM6S4L2T3Um4=; From: Daniel Mendler In-Reply-To: <87wmg8llw1.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 09 Dec 2024 21:03:10 +0200") 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> Date: Mon, 09 Dec 2024 20:28:06 +0100 Message-ID: <877c884px5.fsf@daniel-mendler.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Juri Linkov writes: >> I attached a patch which adds a customization option >> `completion-eager-display' and an `eager-display' completion table >> metadata. The customization option can be set to nil (never), t (always) >> or to auto, which means that the *Completions* buffer will only be shown >> if the completion table requests eager display via the `eager-display' >> metadata. >> >> I updated ffap.el, tmm.el and imenu.el to take advantage of the new >> `eager-display' metadata. I added completion categories where missing >> such that overriding the metadata becomes possible. If desired, the >> metadata can be moved to `completion-category-defaults' instead. > > Thanks, I tested everything, and it works nicely. Thanks for testing! > One small detail that could be added later is to extend > the customization type of `completion-category-overrides' > :value-type with `eager-display'. Since currently > only programmatic use is supported. Okay, I will add this to to custom type. > Also tried to do: > > (add-to-list 'completion-category-overrides > '(tmm (eager-display . nil))) > > but after typing TAB it pops up the completion buffer > where all functionality is lost. Is this because > `tmm-add-prompt' is called only for non-nil `eager-display'? I see. The keymap is not set up properly anymore if `tmm-add-prompt' is disabled. I will add a fix. Daniel From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Dec 2024 19:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: Eli Zaretskii , 74616@debbugs.gnu.org, Stefan Monnier Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.17337739586618 (code B ref 74616); Mon, 09 Dec 2024 19:53:02 +0000 Received: (at 74616) by debbugs.gnu.org; 9 Dec 2024 19:52:38 +0000 Received: from localhost ([127.0.0.1]:55718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjo4-0001iX-DQ for submit@debbugs.gnu.org; Mon, 09 Dec 2024 14:52:37 -0500 Received: from server.qxqx.de ([49.12.34.165]:42905 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjo1-0001hr-Lk for 74616@debbugs.gnu.org; Mon, 09 Dec 2024 14:52:35 -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=bUfURG+spWk2CsfYD2DVlFN9Tbu30y0pCVn+sao21BU=; b=jlMedQmNrRxn4t7Dd7aLganmg7 X9FmX+xdf99V+eSmAzfWRzmjIK01p0hl/aqzEEMvrWsEEI3pqYAZhq2qJDwH8rqcBtGEPHNlsC6Lx 602G6nrOAN7EdE8pwetMbXvk+iBsojbzr2Kd9+3TMoRD8wy1te+wehRFnv4v7UY36Abw=; From: Daniel Mendler In-Reply-To: <87wmg8llw1.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 09 Dec 2024 21:03:10 +0200") 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> Date: Mon, 09 Dec 2024 20:52:25 +0100 Message-ID: <877c88k51i.fsf@daniel-mendler.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Juri Linkov writes: >> I attached a patch which adds a customization option >> `completion-eager-display' and an `eager-display' completion table >> metadata. The customization option can be set to nil (never), t (always) >> or to auto, which means that the *Completions* buffer will only be shown >> if the completion table requests eager display via the `eager-display' >> metadata. >> >> I updated ffap.el, tmm.el and imenu.el to take advantage of the new >> `eager-display' metadata. I added completion categories where missing >> such that overriding the metadata becomes possible. If desired, the >> metadata can be moved to `completion-category-defaults' instead. > > Thanks, I tested everything, and it works nicely. > > One small detail that could be added later is to extend > the customization type of `completion-category-overrides' > :value-type with `eager-display'. Since currently > only programmatic use is supported. > > Also tried to do: > > (add-to-list 'completion-category-overrides > '(tmm (eager-display . nil))) > > but after typing TAB it pops up the completion buffer > where all functionality is lost. Is this because > `tmm-add-prompt' is called only for non-nil `eager-display'? See the new patch which I've attached to this mail, with the two improvements. Daniel --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-New-customization-variable-completion-eager-display.patch >From 274bfcc7ddb64cd18b214d0884d985ebde2d6c70 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Sun, 8 Dec 2024 20:05:07 +0100 Subject: [PATCH] New customization variable `completion-eager-display' The customization option can be set to t or nil, to respectively always or never show the *Completions* buffer eagerly at the beginning of a completion session. Furthermore the option can be set to the value auto. In this case the *Completions* buffer will only be shown if requested by the completion table. Completion tables can use the `eager-display' completion metadata to do so. * lisp/minibuffer.el (completion-eager-display): New customization variable. (completion-metadata): Update docstring, document the new `eager-display' completion metadata. (completion-extra-properties): Update docstring, document the new `:eager-display' completion metadata. (completion-category-overrides): Add `eager-display' to the custom type specification. (completing-read-default): Handle the `completion-eager-display' customization variable and the `eager-display' completion metadata. (completion-table-with-metadata): New function to create a completion table with metadata. (minibuffer-complete-defaults, minibuffer-complete-history): Use it. * lisp/ffap.el (ffap-menu-ask): Add `ffap-menu' completion category and `eager-display' completion metadata. Use `completion-table-with-metadata'. * lisp/imenu.el (imenu-eager-completion-buffer): Correct docstring, which had been inverted. (imenu--completion-buffer): Add `eager-display' completion metadata. Use `completion-table-with-metadata'. * lisp/tmm.el (tmm-prompt): Add `tmm' completion category and `eager-display' completion metadata. Use `completion-table-with-metadata'. Add keymap setup. (tmm-add-prompt): Remove keymap setup. (tmm-goto-completions): Call `tmm-add-prompt' to ensure that a *Completions* buffer is shown. (tmm--completion-table): Remove unused internal function. --- lisp/ffap.el | 17 ++++++------- lisp/imenu.el | 40 +++++++++++++++---------------- lisp/minibuffer.el | 60 ++++++++++++++++++++++++++++++++++++---------- lisp/tmm.el | 19 ++++++++------- 4 files changed, 86 insertions(+), 50 deletions(-) diff --git a/lisp/ffap.el b/lisp/ffap.el index 6a4915fb5a3..c869e234140 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1738,14 +1738,15 @@ ffap-menu-ask alist)))))) ;; minibuffer with completion buffer: (t - (let ((minibuffer-setup-hook 'minibuffer-completion-help)) - ;; Bug: prompting may assume unique strings, no "". - (setq choice - (completing-read - (format-prompt title (car (car alist))) - alist nil t - ;; (cons (car (car alist)) 0) - nil))) + ;; Bug: prompting may assume unique strings, no "". + (setq choice + (completing-read + (format-prompt title (car (car alist))) + (completion-table-with-metadata + alist '((category . ffap-menu) (eager-display . t))) + nil t + ;; (cons (car (car alist)) 0) + nil)) (sit-for 0) ; redraw original screen ;; Convert string to its entry, or else the default: (setq choice (or (assoc choice alist) (car alist))))) diff --git a/lisp/imenu.el b/lisp/imenu.el index 2d64970bfcf..ba1ba5fcd00 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -100,7 +100,7 @@ imenu-use-popup-menu (other :tag "Always" t))) (defcustom imenu-eager-completion-buffer t - "If non-nil, eagerly pop up the completion buffer." + "If nil, eagerly pop up the completion buffer." :type 'boolean :version "22.1") @@ -767,27 +767,25 @@ imenu--completion-buffer (imenu--in-alist name prepared-index-alist) ;; Default to `name' if it's in the alist. name)))) - ;; Display the completion buffer. (minibuffer-with-setup-hook - (lambda () - (setq-local minibuffer-allow-text-properties t) - (setq-local completion-extra-properties - `( :category imenu - ,@(when (eq imenu-flatten 'annotation) - `(:annotation-function - ,(lambda (s) (get-text-property - 0 'imenu-section s)))) - ,@(when (eq imenu-flatten 'group) - `(:group-function - ,(lambda (s transform) - (if transform s - (get-text-property - 0 'imenu-section s))))))) - (unless imenu-eager-completion-buffer - (minibuffer-completion-help))) - (setq name (completing-read prompt - prepared-index-alist - nil t nil 'imenu--history-list name))) + (lambda () (setq-local minibuffer-allow-text-properties t)) + (setq name (completing-read + prompt + (completion-table-with-metadata + prepared-index-alist + `((category . imenu) + (eager-display . ,(not imenu-eager-completion-buffer)) + ,@(when (eq imenu-flatten 'annotation) + `((annotation-function + . ,(lambda (s) (get-text-property + 0 'imenu-section s))))) + ,@(when (eq imenu-flatten 'group) + `((group-function + . ,(lambda (s transform) + (if transform s + (get-text-property + 0 'imenu-section s)))))))) + nil t nil 'imenu--history-list name))) (when (stringp name) (or (get-text-property 0 'imenu-choice name) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 405ee21cdb2..b0fec75cd0a 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -138,6 +138,9 @@ completion-metadata of completions. Can operate destructively. - `cycle-sort-function': function to sort entries when cycling. Works like `display-sort-function'. +- `eager-display': non-nil to request eager display of the + completion candidates. Can also be a function which is invoked + after minibuffer setup. The metadata of a completion table should be constant between two boundaries." (let ((metadata (if (functionp table) (funcall table string pred 'metadata)))) @@ -277,6 +280,15 @@ completion-table-case-fold (let ((completion-ignore-case (not dont-fold))) (complete-with-action action table string pred)))) +(defun completion-table-with-metadata (table metadata) + "Return new completion TABLE with METADATA. +METADATA should be an alist of completion metadata. See +`completion-metadata' for a list of supported metadata." + (lambda (string pred action) + (if (eq action 'metadata) + `(metadata . ,metadata) + (complete-with-action action table string pred)))) + (defun completion-table-subvert (table s1 s2) "Return a completion table from TABLE with S1 replaced by S2. The result is a completion table which completes strings of the @@ -1031,6 +1043,18 @@ minibuffer--completion-prompt-end (defvar completion-show-inline-help t "If non-nil, print helpful inline messages during completion.") +(defcustom completion-eager-display 'auto + "Display the *Completions* buffer eagerly. + +If the variable is set to t or nil, respectively show the *Completions* +buffer always or never eagerly. The value `auto' shows the +*Completions* buffer eagerly only if requested by the completion +command. Completion tables can request eager display via the +`eager-display' metadata." + :type '(choice (const :tag "Never show *Completions* eagerly" nil) + (const :tag "Always show *Completions* eagerly" t) + (const :tag "If requested by the completion command" auto))) + (defcustom completion-auto-help t "Non-nil means automatically provide help for invalid completion input. If the value is t, the *Completions* buffer is displayed whenever completion @@ -1247,7 +1271,11 @@ completion-category-overrides (cons :tag "Completion Affixation" (const :tag "Select one value from the menu." affixation-function) - (choice (function :tag "Custom function")))))) + (choice (function :tag "Custom function"))) + (cons :tag "Eager display" + (const :tag "Select one value from the menu." + eager-display) + boolean)))) (defun completion--category-override (category tag) (or (assq tag (cdr (assq category completion-category-overrides))) @@ -2493,6 +2521,8 @@ completion-extra-properties `:cycle-sort-function': Function to sort entries when cycling. +`:eager-display': Show the *Completions* buffer eagerly. + See more information about these functions above in `completion-metadata'. @@ -4809,7 +4839,17 @@ completing-read-default (setq-local minibuffer--require-match require-match) (setq-local minibuffer--original-buffer buffer) ;; Copy the value from original buffer to the minibuffer. - (setq-local completion-ignore-case c-i-c)) + (setq-local completion-ignore-case c-i-c) + ;; Show the completion help eagerly if + ;; `completion-eager-display' is t or if eager display + ;; has been requested by the completion table. + (when completion-eager-display + (let* ((md (completion-metadata + initial-input collection predicate)) + (fun (completion-metadata-get md 'eager-display))) + (when (or fun (eq completion-eager-display t)) + (funcall (if (functionp fun) + fun #'minibuffer-completion-help)))))) (read-from-minibuffer prompt initial-input keymap nil hist def inherit-input-method)))) (when (and (equal result "") def) @@ -4999,11 +5039,9 @@ minibuffer-complete-history (lambda () (get-buffer-window "*Completions*" 0)))) (completion-in-region (minibuffer--completion-prompt-end) (point-max) - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (display-sort-function . identity) - (cycle-sort-function . identity)) - (complete-with-action action completions string pred))))))) + (completion-table-with-metadata + completions '((display-sort-function . identity) + (cycle-sort-function . identity))))))) (defun minibuffer-complete-defaults () "Complete minibuffer defaults as far as possible. @@ -5019,11 +5057,9 @@ minibuffer-complete-defaults (lambda () (get-buffer-window "*Completions*" 0)))) (completion-in-region (minibuffer--completion-prompt-end) (point-max) - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (display-sort-function . identity) - (cycle-sort-function . identity)) - (complete-with-action action completions string pred)))))) + (completion-table-with-metadata + completions '((display-sort-function . identity) + (cycle-sort-function . identity)))))) (define-key minibuffer-local-map [?\C-x up] 'minibuffer-complete-history) (define-key minibuffer-local-map [?\C-x down] 'minibuffer-complete-defaults) diff --git a/lisp/tmm.el b/lisp/tmm.el index 632e55e47a8..45afbe4a3c2 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el @@ -119,12 +119,6 @@ tmm-inactive '((t :inherit shadow)) "Face used for inactive menu items.") -(defun tmm--completion-table (items) - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (display-sort-function . identity)) - (complete-with-action action items string pred)))) - (defvar tmm--history nil) ;;;###autoload @@ -222,7 +216,9 @@ tmm-prompt (setq out (if default-item (car (nth index-of-default tmm-km-list)) - (minibuffer-with-setup-hook #'tmm-add-prompt + (minibuffer-with-setup-hook + (lambda () + (setq tmm-old-mb-map (tmm-define-keys t))) ;; tmm-km-list is reversed, because history ;; needs it in LIFO order. But default list ;; needs it in non-reverse order, so that the @@ -233,7 +229,12 @@ tmm-prompt (completing-read-default (concat gl-str " (up/down to change, PgUp to menu): ") - (tmm--completion-table tmm-km-list) nil t nil + (completion-table-with-metadata + tmm-km-list '((category . tmm) + (eager-display . tmm-add-prompt) + (display-sort-function . identity) + (cycle-sort-function . identity))) + nil t nil 'tmm--history (reverse tmm--history))))))) (if (and (stringp out) (string= "^" out)) ;; A fake choice to please the destructuring later. @@ -402,7 +403,6 @@ tmm-remove-inactive-mouse-face (defun tmm-add-prompt () (unless tmm-c-prompt (error "No active menu entries")) - (setq tmm-old-mb-map (tmm-define-keys t)) (or tmm-completion-prompt (add-hook 'completion-setup-hook #'tmm-completion-delete-prompt 'append)) @@ -458,6 +458,7 @@ tmm-shortcut (defun tmm-goto-completions () "Jump to the completions buffer." (interactive) + (tmm-add-prompt) (setq tmm-c-prompt (buffer-substring (minibuffer-prompt-end) (point-max))) ;; Clear minibuffer old contents before using *Completions* buffer for ;; selection. -- 2.45.2 --=-=-=-- From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Dec 2024 20:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Daniel Mendler Cc: 74616@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.173377496011651 (code B ref 74616); Mon, 09 Dec 2024 20:10:02 +0000 Received: (at 74616) by debbugs.gnu.org; 9 Dec 2024 20:09:20 +0000 Received: from localhost ([127.0.0.1]:55799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKk4F-00031r-Qe for submit@debbugs.gnu.org; Mon, 09 Dec 2024 15:09:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51696) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKk4B-00031Q-UW for 74616@debbugs.gnu.org; Mon, 09 Dec 2024 15:09:17 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tKk1y-0008Kp-Qi; Mon, 09 Dec 2024 15:06:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=uWq2NqVmlHMXyPcxFlrNnbQMHILD/d18n5uGmerNOHM=; b=ZfFziO2OpMhh RMVkO72wwSBo8Ei5urwGIYVVaNFd3Ve9OZmlk3dZBtV0a4VXe0G5j1Me9VkwFnBcCo6+MyNFybWKr nElPpsD+OWDTEITuHtkZ/um+sPHSfcc9vrwT3VTCpeGb+SqErIHuGJ/BF1iH1LcREIfqN5Eu931ER 1e9CmI0oFTzFVzGK5NgJ2wmHvE39GC6BdD++TVdwJ3wWla0ETIITkDQRFRftyc5esaiuptRD38xW6 0QpidqPhs3iY972C8Q3LWh+D3YEzpDKq87g3p/XKo7THhMvjyM6aSQ8GpHYTI6ThLaH4cFLXzNHid XIvLyqhQD1pAv0m5llrNbg==; Date: Mon, 09 Dec 2024 22:06:48 +0200 Message-Id: <86a5d4d3jb.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <877c884px5.fsf@daniel-mendler.de> (message from Daniel Mendler on Mon, 09 Dec 2024 20:28:06 +0100) 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> <877c884px5.fsf@daniel-mendler.de> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Daniel Mendler > Cc: Stefan Monnier , Eli Zaretskii > , 74616@debbugs.gnu.org > Date: Mon, 09 Dec 2024 20:28:06 +0100 > > Juri Linkov writes: > > > One small detail that could be added later is to extend > > the customization type of `completion-category-overrides' > > :value-type with `eager-display'. Since currently > > only programmatic use is supported. > > Okay, I will add this to to custom type. Please also add a :version tag. The doc string of the defcustom could also be improved. I think the first line should say Whether completion commands should display *Completions* buffer eagerly. Also, the part about requesting the eager display via the `eager-display' metadata should probably be expanded, because it's too terse to be useful. I would also suggest to explain what "eagerly" means in this ciontext. Thanks. From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Dec 2024 20:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Daniel Mendler Cc: 74616@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.173377503412260 (code B ref 74616); Mon, 09 Dec 2024 20:11:02 +0000 Received: (at 74616) by debbugs.gnu.org; 9 Dec 2024 20:10:34 +0000 Received: from localhost ([127.0.0.1]:55808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKk5S-0003Bg-9i for submit@debbugs.gnu.org; Mon, 09 Dec 2024 15:10:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37890) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKk5P-0003BE-E0 for 74616@debbugs.gnu.org; Mon, 09 Dec 2024 15:10:32 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tKk3C-0008OR-VH; Mon, 09 Dec 2024 15:08:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=mnUFAC0qycNQNYNEd5LfgQP8cNeoYezw77wTj6hVVR8=; b=lWLX2vvGRO0b xIE9Ju8rALEKfTDCZvnTu6xBhAMfZPg4jkjCJMF7X4wzkpvbRFbtDj68dCqDYE6hVLDcKsUGewibp 7E2T6DtYYqXm4vUCVP4Zp9ZPxoKS5LEAcoqld0DrnaR40vBpOwIFMwS6/WVWmJcMNBE4hm7FRzXwf DnYqIi2W5lVElFep7HxON6G3H4K00GJ/Z3raZe74F/ZHikIWmcb37F/PdDkIVXltBxFeXVsiahNj+ fcXTlWA9bbhtVnLDm9pPD3ZROP1mXrWZ4+eOH8lAHTAqY7PNY2awTow/e477FZJDmdF7ZD91JnDKg LAJWnw3qdQUWowYB4QASqg==; Date: Mon, 09 Dec 2024 22:08:08 +0200 Message-Id: <868qsod3h3.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <877c88k51i.fsf@daniel-mendler.de> (message from Daniel Mendler on Mon, 09 Dec 2024 20:52:25 +0100) 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> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Daniel Mendler > Cc: Stefan Monnier , Eli Zaretskii > , 74616@debbugs.gnu.org > Date: Mon, 09 Dec 2024 20:52:25 +0100 > > See the new patch which I've attached to this mail, with the two > improvements. Does this deserve a NEWS entry? From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Dec 2024 20:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: mail@daniel-mendler.de Cc: 74616@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.173377513512711 (code B ref 74616); Mon, 09 Dec 2024 20:13:02 +0000 Received: (at 74616) by debbugs.gnu.org; 9 Dec 2024 20:12:15 +0000 Received: from localhost ([127.0.0.1]:55813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKk74-0003Ix-Qb for submit@debbugs.gnu.org; Mon, 09 Dec 2024 15:12:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45130) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKk73-0003IW-70 for 74616@debbugs.gnu.org; Mon, 09 Dec 2024 15:12:13 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tKk6x-0000O4-ES; Mon, 09 Dec 2024 15:12:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=CMaoNdJAhLizMXO52HOkM43cgT/wf/HtajLOFik8ipk=; b=ab2NYZ9QXxT/ DHujvzCYSOGSPsSEufswvVqZEooSHIi9FDUFD644bm+AmwRJbIM3Uk2r0FA9B43OT46DtPSdQufYU JvoRo2VzOaxdPjo0BxFcNpcEj5+YSB8p748f1nTX6jKzhsVspgj1t7trFZuYaCX6TToH3NU7Z/xmi m/ZoG3Q1kRfCS4BFbJDw8B1A4Zbc03v3YBuhSIbDroxvaLxZSMECWYPgxb38j41jpdsTNQPOeCeqY VFyHSJvKrRdjhi4/Dkhh5MSeXHNSPezON80IsSzbRIe05DOkBJEf26juALtqRZ26aztzMWLBsBTVU BQv2HFekHLzb1Oct/789qw==; Date: Mon, 09 Dec 2024 22:12:02 +0200 Message-Id: <867c88d3al.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <86a5d4d3jb.fsf@gnu.org> (message from Eli Zaretskii on Mon, 09 Dec 2024 22:06:48 +0200) 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> <877c884px5.fsf@daniel-mendler.de> <86a5d4d3jb.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 74616@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net > Date: Mon, 09 Dec 2024 22:06:48 +0200 > From: Eli Zaretskii > > Please also add a :version tag. > > The doc string of the defcustom could also be improved. I think the > first line should say > > Whether completion commands should display *Completions* buffer eagerly. > > Also, the part about requesting the eager display via the > `eager-display' metadata should probably be expanded, because it's too > terse to be useful. I would also suggest to explain what "eagerly" > means in this ciontext. Oh, and please also mention the bug number in the commit log message. From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Dec 2024 20:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 74616@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.173377638418703 (code B ref 74616); Mon, 09 Dec 2024 20:34:02 +0000 Received: (at 74616) by debbugs.gnu.org; 9 Dec 2024 20:33:04 +0000 Received: from localhost ([127.0.0.1]:55851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKkRC-0004ra-UM for submit@debbugs.gnu.org; Mon, 09 Dec 2024 15:33:03 -0500 Received: from server.qxqx.de ([49.12.34.165]:50639 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKkR9-0004qm-8l for 74616@debbugs.gnu.org; Mon, 09 Dec 2024 15:33:01 -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=T/9He8Fk4PIEflY2OBYKiKMr9x///revAXwp0PhRZ/c=; b=sxDrQE0kdAEFPvpY02eAf1o+Zq 6yVUSjYHstbwvyl80+gn/83Mwm5q3hVXsnvtqqTjlZ/9P51rzX2OFsWwL926K5qtMVa+1lk7po4zW BAEJmgEkR2NQwFkGNhOw+6dk81x8XaOyLoPKQs3yAL/kB8mxkVFKnkamfSWPsrSJav6o=; From: Daniel Mendler In-Reply-To: <868qsod3h3.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 09 Dec 2024 22:08:08 +0200") 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> Date: Mon, 09 Dec 2024 21:32:49 +0100 Message-ID: <87o71kfvgu.fsf@daniel-mendler.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Daniel Mendler >> Cc: Stefan Monnier , Eli Zaretskii >> , 74616@debbugs.gnu.org >> Date: Mon, 09 Dec 2024 20:52:25 +0100 >> >> See the new patch which I've attached to this mail, with the two >> improvements. > > Does this deserve a NEWS entry? I've added a :version tag to the defcustom and expanded the docstring. Furthermore the commit message includes the bug numbers and there is a NEWS entry. See the updated patch attached to this mail. Daniel --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-New-customization-variable-completion-eager-display.patch >From b3293d0a25ef718409a3180793cb0aaa30aa4c86 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Sun, 8 Dec 2024 20:05:07 +0100 Subject: [PATCH] New customization variable `completion-eager-display' The customization option can be set to t or nil, to respectively always or never show the *Completions* buffer eagerly at the beginning of a completion session. Furthermore the option can be set to the value auto. In this case the *Completions* buffer will only be shown if requested by the completion table. Completion tables can use the `eager-display' completion metadata to do so. (Bug#74616, Bug#74617) * lisp/minibuffer.el (completion-eager-display): New customization variable. (completion-metadata): Update docstring, document the new `eager-display' completion metadata. (completion-extra-properties): Update docstring, document the new `:eager-display' completion metadata. (completion-category-overrides): Add `eager-display' to the custom type specification. (completing-read-default): Handle the `completion-eager-display' customization variable and the `eager-display' completion metadata. (completion-table-with-metadata): New function to create a completion table with metadata. (minibuffer-complete-defaults, minibuffer-complete-history): Use it. * lisp/ffap.el (ffap-menu-ask): Add `ffap-menu' completion category and `eager-display' completion metadata. Use `completion-table-with-metadata'. * lisp/imenu.el (imenu-eager-completion-buffer): Correct docstring, which had been inverted. (imenu--completion-buffer): Add `eager-display' completion metadata. Use `completion-table-with-metadata'. * lisp/tmm.el (tmm-prompt): Add `tmm' completion category and `eager-display' completion metadata. Use `completion-table-with-metadata'. Add keymap setup. (tmm-add-prompt): Remove keymap setup. (tmm-goto-completions): Call `tmm-add-prompt' to ensure that a *Completions* buffer is shown. (tmm--completion-table): Remove unused internal function. * etc/NEWS: Announce the change. --- etc/NEWS | 8 ++++++ lisp/ffap.el | 17 ++++++------ lisp/imenu.el | 40 +++++++++++++-------------- lisp/minibuffer.el | 67 +++++++++++++++++++++++++++++++++++++--------- lisp/tmm.el | 19 ++++++------- 5 files changed, 101 insertions(+), 50 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 3efce149dbf..043e55edf3e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -96,6 +96,14 @@ files and features. ** Minibuffer and Completions ++++ +*** New user option 'completion-eager-display'. +This option configures whether completion commands should display +the *Completions* buffer immediately. When the variable is set to t all +completion commands show *Completions* immediately, respectively nil +disables the eager display for all commands. The default setting auto +enables eager completion only if requested by the command. + +++ *** New user option 'completion-pcm-leading-wildcard'. This option configures how the partial-completion style does completion. diff --git a/lisp/ffap.el b/lisp/ffap.el index 6a4915fb5a3..c869e234140 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1738,14 +1738,15 @@ ffap-menu-ask alist)))))) ;; minibuffer with completion buffer: (t - (let ((minibuffer-setup-hook 'minibuffer-completion-help)) - ;; Bug: prompting may assume unique strings, no "". - (setq choice - (completing-read - (format-prompt title (car (car alist))) - alist nil t - ;; (cons (car (car alist)) 0) - nil))) + ;; Bug: prompting may assume unique strings, no "". + (setq choice + (completing-read + (format-prompt title (car (car alist))) + (completion-table-with-metadata + alist '((category . ffap-menu) (eager-display . t))) + nil t + ;; (cons (car (car alist)) 0) + nil)) (sit-for 0) ; redraw original screen ;; Convert string to its entry, or else the default: (setq choice (or (assoc choice alist) (car alist))))) diff --git a/lisp/imenu.el b/lisp/imenu.el index 2d64970bfcf..ba1ba5fcd00 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -100,7 +100,7 @@ imenu-use-popup-menu (other :tag "Always" t))) (defcustom imenu-eager-completion-buffer t - "If non-nil, eagerly pop up the completion buffer." + "If nil, eagerly pop up the completion buffer." :type 'boolean :version "22.1") @@ -767,27 +767,25 @@ imenu--completion-buffer (imenu--in-alist name prepared-index-alist) ;; Default to `name' if it's in the alist. name)))) - ;; Display the completion buffer. (minibuffer-with-setup-hook - (lambda () - (setq-local minibuffer-allow-text-properties t) - (setq-local completion-extra-properties - `( :category imenu - ,@(when (eq imenu-flatten 'annotation) - `(:annotation-function - ,(lambda (s) (get-text-property - 0 'imenu-section s)))) - ,@(when (eq imenu-flatten 'group) - `(:group-function - ,(lambda (s transform) - (if transform s - (get-text-property - 0 'imenu-section s))))))) - (unless imenu-eager-completion-buffer - (minibuffer-completion-help))) - (setq name (completing-read prompt - prepared-index-alist - nil t nil 'imenu--history-list name))) + (lambda () (setq-local minibuffer-allow-text-properties t)) + (setq name (completing-read + prompt + (completion-table-with-metadata + prepared-index-alist + `((category . imenu) + (eager-display . ,(not imenu-eager-completion-buffer)) + ,@(when (eq imenu-flatten 'annotation) + `((annotation-function + . ,(lambda (s) (get-text-property + 0 'imenu-section s))))) + ,@(when (eq imenu-flatten 'group) + `((group-function + . ,(lambda (s transform) + (if transform s + (get-text-property + 0 'imenu-section s)))))))) + nil t nil 'imenu--history-list name))) (when (stringp name) (or (get-text-property 0 'imenu-choice name) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 405ee21cdb2..71b77683bb5 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -138,6 +138,9 @@ completion-metadata of completions. Can operate destructively. - `cycle-sort-function': function to sort entries when cycling. Works like `display-sort-function'. +- `eager-display': non-nil to request eager display of the + completion candidates. Can also be a function which is invoked + after minibuffer setup. The metadata of a completion table should be constant between two boundaries." (let ((metadata (if (functionp table) (funcall table string pred 'metadata)))) @@ -277,6 +280,15 @@ completion-table-case-fold (let ((completion-ignore-case (not dont-fold))) (complete-with-action action table string pred)))) +(defun completion-table-with-metadata (table metadata) + "Return new completion TABLE with METADATA. +METADATA should be an alist of completion metadata. See +`completion-metadata' for a list of supported metadata." + (lambda (string pred action) + (if (eq action 'metadata) + `(metadata . ,metadata) + (complete-with-action action table string pred)))) + (defun completion-table-subvert (table s1 s2) "Return a completion table from TABLE with S1 replaced by S2. The result is a completion table which completes strings of the @@ -1031,6 +1043,25 @@ minibuffer--completion-prompt-end (defvar completion-show-inline-help t "If non-nil, print helpful inline messages during completion.") +(defcustom completion-eager-display 'auto + "Whether completion commands should display *Completions* buffer eagerly. + +If the variable is set to t, completion commands show the *Completions* +buffer always immediately. Setting the variable to nil disables the +eager *Completions* display for all commands. + +For the value `auto', completion commands show the *Completions* buffer +immediately only if requested by the completion command. Completion +tables can request eager display via the `eager-display' metadata. + +See also the variables `completion-category-overrides' and +`completion-extra-properties' for the `eager-display' completion +metadata." + :type '(choice (const :tag "Never show *Completions* eagerly" nil) + (const :tag "Always show *Completions* eagerly" t) + (const :tag "If requested by the completion command" auto)) + :version "31.1") + (defcustom completion-auto-help t "Non-nil means automatically provide help for invalid completion input. If the value is t, the *Completions* buffer is displayed whenever completion @@ -1247,7 +1278,11 @@ completion-category-overrides (cons :tag "Completion Affixation" (const :tag "Select one value from the menu." affixation-function) - (choice (function :tag "Custom function")))))) + (choice (function :tag "Custom function"))) + (cons :tag "Eager display" + (const :tag "Select one value from the menu." + eager-display) + boolean)))) (defun completion--category-override (category tag) (or (assq tag (cdr (assq category completion-category-overrides))) @@ -2493,6 +2528,8 @@ completion-extra-properties `:cycle-sort-function': Function to sort entries when cycling. +`:eager-display': Show the *Completions* buffer eagerly. + See more information about these functions above in `completion-metadata'. @@ -4809,7 +4846,17 @@ completing-read-default (setq-local minibuffer--require-match require-match) (setq-local minibuffer--original-buffer buffer) ;; Copy the value from original buffer to the minibuffer. - (setq-local completion-ignore-case c-i-c)) + (setq-local completion-ignore-case c-i-c) + ;; Show the completion help eagerly if + ;; `completion-eager-display' is t or if eager display + ;; has been requested by the completion table. + (when completion-eager-display + (let* ((md (completion-metadata + initial-input collection predicate)) + (fun (completion-metadata-get md 'eager-display))) + (when (or fun (eq completion-eager-display t)) + (funcall (if (functionp fun) + fun #'minibuffer-completion-help)))))) (read-from-minibuffer prompt initial-input keymap nil hist def inherit-input-method)))) (when (and (equal result "") def) @@ -4999,11 +5046,9 @@ minibuffer-complete-history (lambda () (get-buffer-window "*Completions*" 0)))) (completion-in-region (minibuffer--completion-prompt-end) (point-max) - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (display-sort-function . identity) - (cycle-sort-function . identity)) - (complete-with-action action completions string pred))))))) + (completion-table-with-metadata + completions '((display-sort-function . identity) + (cycle-sort-function . identity))))))) (defun minibuffer-complete-defaults () "Complete minibuffer defaults as far as possible. @@ -5019,11 +5064,9 @@ minibuffer-complete-defaults (lambda () (get-buffer-window "*Completions*" 0)))) (completion-in-region (minibuffer--completion-prompt-end) (point-max) - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (display-sort-function . identity) - (cycle-sort-function . identity)) - (complete-with-action action completions string pred)))))) + (completion-table-with-metadata + completions '((display-sort-function . identity) + (cycle-sort-function . identity)))))) (define-key minibuffer-local-map [?\C-x up] 'minibuffer-complete-history) (define-key minibuffer-local-map [?\C-x down] 'minibuffer-complete-defaults) diff --git a/lisp/tmm.el b/lisp/tmm.el index 632e55e47a8..45afbe4a3c2 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el @@ -119,12 +119,6 @@ tmm-inactive '((t :inherit shadow)) "Face used for inactive menu items.") -(defun tmm--completion-table (items) - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (display-sort-function . identity)) - (complete-with-action action items string pred)))) - (defvar tmm--history nil) ;;;###autoload @@ -222,7 +216,9 @@ tmm-prompt (setq out (if default-item (car (nth index-of-default tmm-km-list)) - (minibuffer-with-setup-hook #'tmm-add-prompt + (minibuffer-with-setup-hook + (lambda () + (setq tmm-old-mb-map (tmm-define-keys t))) ;; tmm-km-list is reversed, because history ;; needs it in LIFO order. But default list ;; needs it in non-reverse order, so that the @@ -233,7 +229,12 @@ tmm-prompt (completing-read-default (concat gl-str " (up/down to change, PgUp to menu): ") - (tmm--completion-table tmm-km-list) nil t nil + (completion-table-with-metadata + tmm-km-list '((category . tmm) + (eager-display . tmm-add-prompt) + (display-sort-function . identity) + (cycle-sort-function . identity))) + nil t nil 'tmm--history (reverse tmm--history))))))) (if (and (stringp out) (string= "^" out)) ;; A fake choice to please the destructuring later. @@ -402,7 +403,6 @@ tmm-remove-inactive-mouse-face (defun tmm-add-prompt () (unless tmm-c-prompt (error "No active menu entries")) - (setq tmm-old-mb-map (tmm-define-keys t)) (or tmm-completion-prompt (add-hook 'completion-setup-hook #'tmm-completion-delete-prompt 'append)) @@ -458,6 +458,7 @@ tmm-shortcut (defun tmm-goto-completions () "Jump to the completions buffer." (interactive) + (tmm-add-prompt) (setq tmm-c-prompt (buffer-substring (minibuffer-prompt-end) (point-max))) ;; Clear minibuffer old contents before using *Completions* buffer for ;; selection. -- 2.45.2 --=-=-=-- From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Dec 2024 07:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Daniel Mendler Cc: Eli Zaretskii , 74616@debbugs.gnu.org, Stefan Monnier Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.17338169973034 (code B ref 74616); Tue, 10 Dec 2024 07:50:02 +0000 Received: (at 74616) by debbugs.gnu.org; 10 Dec 2024 07:49:57 +0000 Received: from localhost ([127.0.0.1]:56805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKv0G-0000mr-NN for submit@debbugs.gnu.org; Tue, 10 Dec 2024 02:49:56 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:52605) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKv0C-0000mI-Jj for 74616@debbugs.gnu.org; Tue, 10 Dec 2024 02:49:53 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id D0BEA1C0007; Tue, 10 Dec 2024 07:49:43 +0000 (UTC) From: Juri Linkov In-Reply-To: <877c88k51i.fsf@daniel-mendler.de> (Daniel Mendler's message of "Mon, 09 Dec 2024 20:52:25 +0100") Organization: LINKOV.NET 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> Date: Tue, 10 Dec 2024 09:43:31 +0200 Message-ID: <87bjxkq8yk.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > See the new patch which I've attached to this mail, with the two > improvements. Thanks, I confirm that now everything works nicely. BTW, after customizing 'completion-eager-display' to t, its behavior looks like the option 'icomplete-show-matches-on-no-input', and reminds the plans to implement the updating *Completions* as you type. So `eager-display' could be the first step for implementing `eager-update' as well. From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Dec 2024 12:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Daniel Mendler Cc: 74616@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.17338339464143 (code B ref 74616); Tue, 10 Dec 2024 12:33:02 +0000 Received: (at 74616) by debbugs.gnu.org; 10 Dec 2024 12:32:26 +0000 Received: from localhost ([127.0.0.1]:57244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKzPd-00014f-J0 for submit@debbugs.gnu.org; Tue, 10 Dec 2024 07:32:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42168) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKzPb-000142-2y for 74616@debbugs.gnu.org; Tue, 10 Dec 2024 07:32:23 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tKzPU-0003Zt-Bx; Tue, 10 Dec 2024 07:32:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=wVq9lZ4SreKuKML5bWUbRqEMNPZLskDA72IPewGyPFA=; b=DjjVfvasEBDm yyXRF/cQxZHcatYgDdXtvHhKNIaP0tbxGyPAAZiXUXXDt1mwJinnO/jPkkjtMzzIMAGQB4UPWVaip PNDxWlphcROFdfEKmUUuSHMek7Z+p4k4nsoMSFSDV78Nn37F/i+nIy5jp8eWheU67eQ5vHmyMz2/6 qtZSA81x2XSjw/ICc0jIS8tOIkelvOLwUXVcO0kC9+VFQhsQN74ccCQ222lzMXCM3WqYhZFp4cOb6 0ix3aNAtvZlX5J2psGtEoE0O5YB1JI7szSR3T+OGksaiaIvj+cZzL1zsX9UC3jNEPQBDqGmZPYWj1 rVlcmmS22SGe/XvW0LXtHQ==; Date: Tue, 10 Dec 2024 14:32:11 +0200 Message-Id: <86zfl3btx0.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87o71kfvgu.fsf@daniel-mendler.de> (message from Daniel Mendler on Mon, 09 Dec 2024 21:32:49 +0100) 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> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Daniel Mendler > Cc: juri@linkov.net, monnier@iro.umontreal.ca, 74616@debbugs.gnu.org > Date: Mon, 09 Dec 2024 21:32:49 +0100 > > > Does this deserve a NEWS entry? > > I've added a :version tag to the defcustom and expanded the docstring. > Furthermore the commit message includes the bug numbers and there is a > NEWS entry. See the updated patch attached to this mail. Thanks. This LGTM (but let's leave some time for others to chime in), with the following nit: > ++++ > +*** New user option 'completion-eager-display'. > +This option configures whether completion commands should display > +the *Completions* buffer immediately. When the variable is set to t all > +completion commands show *Completions* immediately, respectively nil > +disables the eager display for all commands. The default setting auto ^^ Two spaces there, please. From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Dec 2024 15:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 74616@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.173393145030054 (code B ref 74616); Wed, 11 Dec 2024 15:38:02 +0000 Received: (at 74616) by debbugs.gnu.org; 11 Dec 2024 15:37:30 +0000 Received: from localhost ([127.0.0.1]:35754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLOmG-0007of-RO for submit@debbugs.gnu.org; Wed, 11 Dec 2024 10:37:29 -0500 Received: from server.qxqx.de ([49.12.34.165]:54129 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLOmE-0007oP-Ds for 74616@debbugs.gnu.org; Wed, 11 Dec 2024 10:37:27 -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=DADHNXxTd30O7/jjkqIYX3u11Hm1Juj46KdL+P1soik=; b=HfbhWXw+xxUrAa41CsRJOg5pwW XNJZ2iDB4+KIaO1KGbD/2dUfvfWeO5ZYTSQC1hk5GcaYZ+YCDtozYzgOl0UfV5Kk3xImnMtKTZ501 Q/Il/8KGe6tcA1XSYHqr+7zIqsQrPRwct9ainIas+s7kPqYPiQDidmYz8V1b/BWsCSZU=; From: Daniel Mendler In-Reply-To: <86zfl3btx0.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 10 Dec 2024 14:32:11 +0200") 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> Date: Wed, 11 Dec 2024 16:37:18 +0100 Message-ID: <87ikrqb58x.fsf@daniel-mendler.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Daniel Mendler >> Cc: juri@linkov.net, monnier@iro.umontreal.ca, 74616@debbugs.gnu.org >> Date: Mon, 09 Dec 2024 21:32:49 +0100 >> >> > Does this deserve a NEWS entry? >> >> I've added a :version tag to the defcustom and expanded the docstring. >> Furthermore the commit message includes the bug numbers and there is a >> NEWS entry. See the updated patch attached to this mail. > > Thanks. This LGTM (but let's leave some time for others to chime in), > with the following nit: > >> ++++ >> +*** New user option 'completion-eager-display'. >> +This option configures whether completion commands should display >> +the *Completions* buffer immediately. When the variable is set to t all >> +completion commands show *Completions* immediately, respectively nil >> +disables the eager display for all commands. The default setting auto > ^^ > Two spaces there, please. Thanks. Updated patch attached. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-New-customization-variable-completion-eager-display.patch >From 74714af5d38cfe44d74e22b797557f4369dd3944 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Sun, 8 Dec 2024 20:05:07 +0100 Subject: [PATCH 1/3] New customization variable `completion-eager-display' The customization option can be set to t or nil, to respectively always or never show the *Completions* buffer eagerly at the beginning of a completion session. Furthermore the option can be set to the value auto. In this case the *Completions* buffer will only be shown if requested by the completion table. Completion tables can use the `eager-display' completion metadata to do so. (Bug#74616, Bug#74617) * lisp/minibuffer.el (completion-eager-display): New customization variable. (completion-metadata): Update docstring, document the new `eager-display' completion metadata. (completion-extra-properties): Update docstring, document the new `:eager-display' completion metadata. (completion-category-overrides): Add `eager-display' to the custom type specification. (completing-read-default): Handle the `completion-eager-display' customization variable and the `eager-display' completion metadata. (completion-table-with-metadata): New function to create a completion table with metadata. (minibuffer-complete-defaults, minibuffer-complete-history): Use it. * lisp/ffap.el (ffap-menu-ask): Add `ffap-menu' completion category and `eager-display' completion metadata. Use `completion-table-with-metadata'. * lisp/imenu.el (imenu-eager-completion-buffer): Correct docstring, which had been inverted. (imenu--completion-buffer): Add `eager-display' completion metadata. Use `completion-table-with-metadata'. * lisp/tmm.el (tmm-prompt): Add `tmm' completion category and `eager-display' completion metadata. Use `completion-table-with-metadata'. Add keymap setup. (tmm-add-prompt): Remove keymap setup. (tmm-goto-completions): Call `tmm-add-prompt' to ensure that a *Completions* buffer is shown. (tmm--completion-table): Remove unused internal function. * etc/NEWS: Announce the change. --- etc/NEWS | 8 ++++++ lisp/ffap.el | 17 ++++++------ lisp/imenu.el | 40 +++++++++++++-------------- lisp/minibuffer.el | 67 +++++++++++++++++++++++++++++++++++++--------- lisp/tmm.el | 19 ++++++------- 5 files changed, 101 insertions(+), 50 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 3efce149dbf..2d9590b5a43 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -96,6 +96,14 @@ files and features. ** Minibuffer and Completions ++++ +*** New user option 'completion-eager-display'. +This option configures whether completion commands should display +the *Completions* buffer immediately. When the variable is set to t all +completion commands show *Completions* immediately, respectively nil +disables the eager display for all commands. The default setting auto +enables eager completion only if requested by the command. + +++ *** New user option 'completion-pcm-leading-wildcard'. This option configures how the partial-completion style does completion. diff --git a/lisp/ffap.el b/lisp/ffap.el index 6a4915fb5a3..c869e234140 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1738,14 +1738,15 @@ ffap-menu-ask alist)))))) ;; minibuffer with completion buffer: (t - (let ((minibuffer-setup-hook 'minibuffer-completion-help)) - ;; Bug: prompting may assume unique strings, no "". - (setq choice - (completing-read - (format-prompt title (car (car alist))) - alist nil t - ;; (cons (car (car alist)) 0) - nil))) + ;; Bug: prompting may assume unique strings, no "". + (setq choice + (completing-read + (format-prompt title (car (car alist))) + (completion-table-with-metadata + alist '((category . ffap-menu) (eager-display . t))) + nil t + ;; (cons (car (car alist)) 0) + nil)) (sit-for 0) ; redraw original screen ;; Convert string to its entry, or else the default: (setq choice (or (assoc choice alist) (car alist))))) diff --git a/lisp/imenu.el b/lisp/imenu.el index 2d64970bfcf..ba1ba5fcd00 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -100,7 +100,7 @@ imenu-use-popup-menu (other :tag "Always" t))) (defcustom imenu-eager-completion-buffer t - "If non-nil, eagerly pop up the completion buffer." + "If nil, eagerly pop up the completion buffer." :type 'boolean :version "22.1") @@ -767,27 +767,25 @@ imenu--completion-buffer (imenu--in-alist name prepared-index-alist) ;; Default to `name' if it's in the alist. name)))) - ;; Display the completion buffer. (minibuffer-with-setup-hook - (lambda () - (setq-local minibuffer-allow-text-properties t) - (setq-local completion-extra-properties - `( :category imenu - ,@(when (eq imenu-flatten 'annotation) - `(:annotation-function - ,(lambda (s) (get-text-property - 0 'imenu-section s)))) - ,@(when (eq imenu-flatten 'group) - `(:group-function - ,(lambda (s transform) - (if transform s - (get-text-property - 0 'imenu-section s))))))) - (unless imenu-eager-completion-buffer - (minibuffer-completion-help))) - (setq name (completing-read prompt - prepared-index-alist - nil t nil 'imenu--history-list name))) + (lambda () (setq-local minibuffer-allow-text-properties t)) + (setq name (completing-read + prompt + (completion-table-with-metadata + prepared-index-alist + `((category . imenu) + (eager-display . ,(not imenu-eager-completion-buffer)) + ,@(when (eq imenu-flatten 'annotation) + `((annotation-function + . ,(lambda (s) (get-text-property + 0 'imenu-section s))))) + ,@(when (eq imenu-flatten 'group) + `((group-function + . ,(lambda (s transform) + (if transform s + (get-text-property + 0 'imenu-section s)))))))) + nil t nil 'imenu--history-list name))) (when (stringp name) (or (get-text-property 0 'imenu-choice name) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 405ee21cdb2..71b77683bb5 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -138,6 +138,9 @@ completion-metadata of completions. Can operate destructively. - `cycle-sort-function': function to sort entries when cycling. Works like `display-sort-function'. +- `eager-display': non-nil to request eager display of the + completion candidates. Can also be a function which is invoked + after minibuffer setup. The metadata of a completion table should be constant between two boundaries." (let ((metadata (if (functionp table) (funcall table string pred 'metadata)))) @@ -277,6 +280,15 @@ completion-table-case-fold (let ((completion-ignore-case (not dont-fold))) (complete-with-action action table string pred)))) +(defun completion-table-with-metadata (table metadata) + "Return new completion TABLE with METADATA. +METADATA should be an alist of completion metadata. See +`completion-metadata' for a list of supported metadata." + (lambda (string pred action) + (if (eq action 'metadata) + `(metadata . ,metadata) + (complete-with-action action table string pred)))) + (defun completion-table-subvert (table s1 s2) "Return a completion table from TABLE with S1 replaced by S2. The result is a completion table which completes strings of the @@ -1031,6 +1043,25 @@ minibuffer--completion-prompt-end (defvar completion-show-inline-help t "If non-nil, print helpful inline messages during completion.") +(defcustom completion-eager-display 'auto + "Whether completion commands should display *Completions* buffer eagerly. + +If the variable is set to t, completion commands show the *Completions* +buffer always immediately. Setting the variable to nil disables the +eager *Completions* display for all commands. + +For the value `auto', completion commands show the *Completions* buffer +immediately only if requested by the completion command. Completion +tables can request eager display via the `eager-display' metadata. + +See also the variables `completion-category-overrides' and +`completion-extra-properties' for the `eager-display' completion +metadata." + :type '(choice (const :tag "Never show *Completions* eagerly" nil) + (const :tag "Always show *Completions* eagerly" t) + (const :tag "If requested by the completion command" auto)) + :version "31.1") + (defcustom completion-auto-help t "Non-nil means automatically provide help for invalid completion input. If the value is t, the *Completions* buffer is displayed whenever completion @@ -1247,7 +1278,11 @@ completion-category-overrides (cons :tag "Completion Affixation" (const :tag "Select one value from the menu." affixation-function) - (choice (function :tag "Custom function")))))) + (choice (function :tag "Custom function"))) + (cons :tag "Eager display" + (const :tag "Select one value from the menu." + eager-display) + boolean)))) (defun completion--category-override (category tag) (or (assq tag (cdr (assq category completion-category-overrides))) @@ -2493,6 +2528,8 @@ completion-extra-properties `:cycle-sort-function': Function to sort entries when cycling. +`:eager-display': Show the *Completions* buffer eagerly. + See more information about these functions above in `completion-metadata'. @@ -4809,7 +4846,17 @@ completing-read-default (setq-local minibuffer--require-match require-match) (setq-local minibuffer--original-buffer buffer) ;; Copy the value from original buffer to the minibuffer. - (setq-local completion-ignore-case c-i-c)) + (setq-local completion-ignore-case c-i-c) + ;; Show the completion help eagerly if + ;; `completion-eager-display' is t or if eager display + ;; has been requested by the completion table. + (when completion-eager-display + (let* ((md (completion-metadata + initial-input collection predicate)) + (fun (completion-metadata-get md 'eager-display))) + (when (or fun (eq completion-eager-display t)) + (funcall (if (functionp fun) + fun #'minibuffer-completion-help)))))) (read-from-minibuffer prompt initial-input keymap nil hist def inherit-input-method)))) (when (and (equal result "") def) @@ -4999,11 +5046,9 @@ minibuffer-complete-history (lambda () (get-buffer-window "*Completions*" 0)))) (completion-in-region (minibuffer--completion-prompt-end) (point-max) - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (display-sort-function . identity) - (cycle-sort-function . identity)) - (complete-with-action action completions string pred))))))) + (completion-table-with-metadata + completions '((display-sort-function . identity) + (cycle-sort-function . identity))))))) (defun minibuffer-complete-defaults () "Complete minibuffer defaults as far as possible. @@ -5019,11 +5064,9 @@ minibuffer-complete-defaults (lambda () (get-buffer-window "*Completions*" 0)))) (completion-in-region (minibuffer--completion-prompt-end) (point-max) - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (display-sort-function . identity) - (cycle-sort-function . identity)) - (complete-with-action action completions string pred)))))) + (completion-table-with-metadata + completions '((display-sort-function . identity) + (cycle-sort-function . identity)))))) (define-key minibuffer-local-map [?\C-x up] 'minibuffer-complete-history) (define-key minibuffer-local-map [?\C-x down] 'minibuffer-complete-defaults) diff --git a/lisp/tmm.el b/lisp/tmm.el index 632e55e47a8..45afbe4a3c2 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el @@ -119,12 +119,6 @@ tmm-inactive '((t :inherit shadow)) "Face used for inactive menu items.") -(defun tmm--completion-table (items) - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (display-sort-function . identity)) - (complete-with-action action items string pred)))) - (defvar tmm--history nil) ;;;###autoload @@ -222,7 +216,9 @@ tmm-prompt (setq out (if default-item (car (nth index-of-default tmm-km-list)) - (minibuffer-with-setup-hook #'tmm-add-prompt + (minibuffer-with-setup-hook + (lambda () + (setq tmm-old-mb-map (tmm-define-keys t))) ;; tmm-km-list is reversed, because history ;; needs it in LIFO order. But default list ;; needs it in non-reverse order, so that the @@ -233,7 +229,12 @@ tmm-prompt (completing-read-default (concat gl-str " (up/down to change, PgUp to menu): ") - (tmm--completion-table tmm-km-list) nil t nil + (completion-table-with-metadata + tmm-km-list '((category . tmm) + (eager-display . tmm-add-prompt) + (display-sort-function . identity) + (cycle-sort-function . identity))) + nil t nil 'tmm--history (reverse tmm--history))))))) (if (and (stringp out) (string= "^" out)) ;; A fake choice to please the destructuring later. @@ -402,7 +403,6 @@ tmm-remove-inactive-mouse-face (defun tmm-add-prompt () (unless tmm-c-prompt (error "No active menu entries")) - (setq tmm-old-mb-map (tmm-define-keys t)) (or tmm-completion-prompt (add-hook 'completion-setup-hook #'tmm-completion-delete-prompt 'append)) @@ -458,6 +458,7 @@ tmm-shortcut (defun tmm-goto-completions () "Jump to the completions buffer." (interactive) + (tmm-add-prompt) (setq tmm-c-prompt (buffer-substring (minibuffer-prompt-end) (point-max))) ;; Clear minibuffer old contents before using *Completions* buffer for ;; selection. -- 2.45.2 --=-=-=-- From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Dec 2024 10:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Daniel Mendler Cc: 74616@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.17341723054552 (code B ref 74616); Sat, 14 Dec 2024 10:32:01 +0000 Received: (at 74616) by debbugs.gnu.org; 14 Dec 2024 10:31:45 +0000 Received: from localhost ([127.0.0.1]:45635 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMPR2-0001BL-4y for submit@debbugs.gnu.org; Sat, 14 Dec 2024 05:31:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMPQz-0001B5-EX for 74616@debbugs.gnu.org; Sat, 14 Dec 2024 05:31:42 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMPQs-0001Bo-Bm; Sat, 14 Dec 2024 05:31:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=JLX2WCgziv9aFCVYIPCB3Kn56ie4Qwt9grti9WODLUI=; b=H3CB7mXVsEhh DIepen5klzHpNZjba+9GBlHUrglrPjFCMN+e/yNkoPqSSUkBXJvvMwCHX9Xzho40M2oxLHC45AoT3 S5ppgMb2FE7aadaK+ynObHqtFucZKQ6CcVaOrlU/yVp6MV7Q64IjOdaejOxkdrxye+Vs9LLmF/D87 fgcfw6z/J1G0PJFm0rUOvNvvkmYkWd6QP/9hfeG4HXvpktRjRXJidT7eCghE/t1fERkO5OoqINpDX Dh/0F1tqRLHIS+YJq/UaVtrMuzLgI/cC55hU6VnutGxTJ7ZXyedjl2lkqjMmDhuxvaA0kug4/VZZz Ve2uTNdXiKqm5BdJI3UkGA==; Date: Sat, 14 Dec 2024 12:31:28 +0200 Message-Id: <86ldwiv9mn.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87ikrqb58x.fsf@daniel-mendler.de> (message from Daniel Mendler on Wed, 11 Dec 2024 16:37:18 +0100) 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> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Daniel Mendler > Cc: juri@linkov.net, monnier@iro.umontreal.ca, 74616@debbugs.gnu.org > Date: Wed, 11 Dec 2024 16:37:18 +0100 > > > Thanks. This LGTM (but let's leave some time for others to chime in), > > with the following nit: > > > >> ++++ > >> +*** New user option 'completion-eager-display'. > >> +This option configures whether completion commands should display > >> +the *Completions* buffer immediately. When the variable is set to t all > >> +completion commands show *Completions* immediately, respectively nil > >> +disables the eager display for all commands. The default setting auto > > ^^ > > Two spaces there, please. > > Thanks. Updated patch attached. Thanks. I was about to install this, but it turns out it breaks minibuffer-tests: Test minibuffer-next-completion backtrace: string-match("\\(?:^\\|[^$]\\(?:\\$\\$\\)*\\)\\$\\([[:alnum:]_]*\\|{ completion--embedded-envvar-table(nil nil metadata) complete-with-action(metadata completion--embedded-envvar-table nil #f(compiled-function (table) #)(complet #f(compiled-function (elt) #)(completio mapc(#f(compiled-function (elt) #) (com seq-do(#f(compiled-function (elt) #) (c seq-some(#f(compiled-function (table) # read-file-name-internal(nil nil metadata) completion-metadata(nil read-file-name-internal nil) #f(compiled-function () #)() minibuffer-setup() read-from-minibuffer("Prompt: " nil (keymap (menu-bar keymap (minibu completing-read-default("Prompt: " read-file-name-internal nil nil n completing-read("Prompt: " read-file-name-internal) (let ((executing-kbd-macro t)) (completing-read "Prompt: " #'read-fi (progn (add-hook 'minibuffer-setup-hook setup-hook) (let ((executing (unwind-protect (progn (add-hook 'minibuffer-setup-hook setup-hook) (let ((fun #'(lambda nil (let ((redisplay-skip-initial-frame nil) (e (catch 'result (let ((fun #'(lambda nil (let (... ...) (throw ... .. (let ((default-directory (let* ((testfile (and t "d:/gnu/git/emacs/t #f(lambda () [t] (let ((default-directory (let* ... ...))) (catch 'r #f(compiled-function () #)() handler-bind-1(#f(compiled-function () # Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Dec 2024 11:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 74616@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.173417683818091 (code B ref 74616); Sat, 14 Dec 2024 11:48:01 +0000 Received: (at 74616) by debbugs.gnu.org; 14 Dec 2024 11:47:18 +0000 Received: from localhost ([127.0.0.1]:45759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMQc8-0004hh-I3 for submit@debbugs.gnu.org; Sat, 14 Dec 2024 06:47:17 -0500 Received: from server.qxqx.de ([49.12.34.165]:54689 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMQc1-0004hI-GQ for 74616@debbugs.gnu.org; Sat, 14 Dec 2024 06:47:14 -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=5KzVYFQADjQsf7RcR7jXllKTzLy/pfnblWuTrzeQgig=; b=lzQbcC91fKjlK2FsscarBL1Pku wIOacCT83Dp2bVusc1eu3d9rRLkJzro8X33DSUe1Rr2kvL45qgRCG0E2XqwovHNKGj4dYoruBqhHw 7i+u+K+RIV+Tc54Ifz0JnmfCHNlCItaWIHeCX+UcCpa/vOancCTCzA0OssoLitXU3tfc=; From: Daniel Mendler In-Reply-To: <86ldwiv9mn.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 14 Dec 2024 12:31:28 +0200") 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> Date: Sat, 14 Dec 2024 12:44:48 +0100 Message-ID: <87pllusd3j.fsf@daniel-mendler.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Daniel Mendler >> Cc: juri@linkov.net, monnier@iro.umontreal.ca, 74616@debbugs.gnu.org >> Date: Wed, 11 Dec 2024 16:37:18 +0100 >> >> > Thanks. This LGTM (but let's leave some time for others to chime in), >> > with the following nit: >> > >> >> ++++ >> >> +*** New user option 'completion-eager-display'. >> >> +This option configures whether completion commands should display >> >> +the *Completions* buffer immediately. When the variable is set to t all >> >> +completion commands show *Completions* immediately, respectively nil >> >> +disables the eager display for all commands. The default setting auto >> > ^^ >> > Two spaces there, please. >> >> Thanks. Updated patch attached. > > Thanks. I was about to install this, but it turns out it breaks > minibuffer-tests: 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. Daniel --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-New-customization-variable-completion-eager-display.patch >From f8f93c078dbcc598dac87e7451bdae3e9f80e92b Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Sun, 8 Dec 2024 20:05:07 +0100 Subject: [PATCH 1/4] New customization variable `completion-eager-display' The customization option can be set to t or nil, to respectively always or never show the *Completions* buffer eagerly at the beginning of a completion session. Furthermore the option can be set to the value auto. In this case the *Completions* buffer will only be shown if requested by the completion table. Completion tables can use the `eager-display' completion metadata to do so. (Bug#74616, Bug#74617) * lisp/minibuffer.el (completion-eager-display): New customization variable. (completion-metadata): Update docstring, document the new `eager-display' completion metadata. (completion-extra-properties): Update docstring, document the new `:eager-display' completion metadata. (completion-category-overrides): Add `eager-display' to the custom type specification. (completing-read-default): Handle the `completion-eager-display' customization variable and the `eager-display' completion metadata. (completion-table-with-metadata): New function to create a completion table with metadata. (minibuffer-complete-defaults, minibuffer-complete-history): Use it. * lisp/ffap.el (ffap-menu-ask): Add `ffap-menu' completion category and `eager-display' completion metadata. Use `completion-table-with-metadata'. * lisp/imenu.el (imenu-eager-completion-buffer): Correct docstring, which had been inverted. (imenu--completion-buffer): Add `eager-display' completion metadata. Use `completion-table-with-metadata'. * lisp/tmm.el (tmm-prompt): Add `tmm' completion category and `eager-display' completion metadata. Use `completion-table-with-metadata'. Add keymap setup. (tmm-add-prompt): Remove keymap setup. (tmm-goto-completions): Call `tmm-add-prompt' to ensure that a *Completions* buffer is shown. (tmm--completion-table): Remove unused internal function. * etc/NEWS: Announce the change. --- etc/NEWS | 8 ++++++ lisp/ffap.el | 17 ++++++------ lisp/imenu.el | 40 +++++++++++++-------------- lisp/minibuffer.el | 67 +++++++++++++++++++++++++++++++++++++--------- lisp/tmm.el | 19 ++++++------- 5 files changed, 101 insertions(+), 50 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index d96e49402ba..b847a76f741 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -102,6 +102,14 @@ files and features. ** Minibuffer and Completions ++++ +*** New user option 'completion-eager-display'. +This option configures whether completion commands should display +the *Completions* buffer immediately. When the variable is set to t all +completion commands show *Completions* immediately, respectively nil +disables the eager display for all commands. The default setting auto +enables eager completion only if requested by the command. + +++ *** New user option 'completion-pcm-leading-wildcard'. This option configures how the partial-completion style does completion. diff --git a/lisp/ffap.el b/lisp/ffap.el index 180fe408104..d3110f824a6 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1739,14 +1739,15 @@ ffap-menu-ask alist)))))) ;; minibuffer with completion buffer: (t - (let ((minibuffer-setup-hook 'minibuffer-completion-help)) - ;; Bug: prompting may assume unique strings, no "". - (setq choice - (completing-read - (format-prompt title (car (car alist))) - alist nil t - ;; (cons (car (car alist)) 0) - nil))) + ;; Bug: prompting may assume unique strings, no "". + (setq choice + (completing-read + (format-prompt title (car (car alist))) + (completion-table-with-metadata + alist '((category . ffap-menu) (eager-display . t))) + nil t + ;; (cons (car (car alist)) 0) + nil)) (sit-for 0) ; redraw original screen ;; Convert string to its entry, or else the default: (setq choice (or (assoc choice alist) (car alist))))) diff --git a/lisp/imenu.el b/lisp/imenu.el index 2d64970bfcf..ba1ba5fcd00 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -100,7 +100,7 @@ imenu-use-popup-menu (other :tag "Always" t))) (defcustom imenu-eager-completion-buffer t - "If non-nil, eagerly pop up the completion buffer." + "If nil, eagerly pop up the completion buffer." :type 'boolean :version "22.1") @@ -767,27 +767,25 @@ imenu--completion-buffer (imenu--in-alist name prepared-index-alist) ;; Default to `name' if it's in the alist. name)))) - ;; Display the completion buffer. (minibuffer-with-setup-hook - (lambda () - (setq-local minibuffer-allow-text-properties t) - (setq-local completion-extra-properties - `( :category imenu - ,@(when (eq imenu-flatten 'annotation) - `(:annotation-function - ,(lambda (s) (get-text-property - 0 'imenu-section s)))) - ,@(when (eq imenu-flatten 'group) - `(:group-function - ,(lambda (s transform) - (if transform s - (get-text-property - 0 'imenu-section s))))))) - (unless imenu-eager-completion-buffer - (minibuffer-completion-help))) - (setq name (completing-read prompt - prepared-index-alist - nil t nil 'imenu--history-list name))) + (lambda () (setq-local minibuffer-allow-text-properties t)) + (setq name (completing-read + prompt + (completion-table-with-metadata + prepared-index-alist + `((category . imenu) + (eager-display . ,(not imenu-eager-completion-buffer)) + ,@(when (eq imenu-flatten 'annotation) + `((annotation-function + . ,(lambda (s) (get-text-property + 0 'imenu-section s))))) + ,@(when (eq imenu-flatten 'group) + `((group-function + . ,(lambda (s transform) + (if transform s + (get-text-property + 0 'imenu-section s)))))))) + nil t nil 'imenu--history-list name))) (when (stringp name) (or (get-text-property 0 'imenu-choice name) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 1337fbe17ea..dfc62c25f38 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -138,6 +138,9 @@ completion-metadata of completions. Can operate destructively. - `cycle-sort-function': function to sort entries when cycling. Works like `display-sort-function'. +- `eager-display': non-nil to request eager display of the + completion candidates. Can also be a function which is invoked + after minibuffer setup. The metadata of a completion table should be constant between two boundaries." (let ((metadata (if (functionp table) (funcall table string pred 'metadata)))) @@ -277,6 +280,15 @@ completion-table-case-fold (let ((completion-ignore-case (not dont-fold))) (complete-with-action action table string pred)))) +(defun completion-table-with-metadata (table metadata) + "Return new completion TABLE with METADATA. +METADATA should be an alist of completion metadata. See +`completion-metadata' for a list of supported metadata." + (lambda (string pred action) + (if (eq action 'metadata) + `(metadata . ,metadata) + (complete-with-action action table string pred)))) + (defun completion-table-subvert (table s1 s2) "Return a completion table from TABLE with S1 replaced by S2. The result is a completion table which completes strings of the @@ -1031,6 +1043,25 @@ minibuffer--completion-prompt-end (defvar completion-show-inline-help t "If non-nil, print helpful inline messages during completion.") +(defcustom completion-eager-display 'auto + "Whether completion commands should display *Completions* buffer eagerly. + +If the variable is set to t, completion commands show the *Completions* +buffer always immediately. Setting the variable to nil disables the +eager *Completions* display for all commands. + +For the value `auto', completion commands show the *Completions* buffer +immediately only if requested by the completion command. Completion +tables can request eager display via the `eager-display' metadata. + +See also the variables `completion-category-overrides' and +`completion-extra-properties' for the `eager-display' completion +metadata." + :type '(choice (const :tag "Never show *Completions* eagerly" nil) + (const :tag "Always show *Completions* eagerly" t) + (const :tag "If requested by the completion command" auto)) + :version "31.1") + (defcustom completion-auto-help t "Non-nil means automatically provide help for invalid completion input. If the value is t, the *Completions* buffer is displayed whenever completion @@ -1247,7 +1278,11 @@ completion-category-overrides (cons :tag "Completion Affixation" (const :tag "Select one value from the menu." affixation-function) - (choice (function :tag "Custom function")))))) + (choice (function :tag "Custom function"))) + (cons :tag "Eager display" + (const :tag "Select one value from the menu." + eager-display) + boolean)))) (defun completion--category-override (category tag) (or (assq tag (cdr (assq category completion-category-overrides))) @@ -2499,6 +2534,8 @@ completion-extra-properties `:cycle-sort-function': Function to sort entries when cycling. +`:eager-display': Show the *Completions* buffer eagerly. + See more information about these functions above in `completion-metadata'. @@ -4815,7 +4852,17 @@ completing-read-default (setq-local minibuffer--require-match require-match) (setq-local minibuffer--original-buffer buffer) ;; Copy the value from original buffer to the minibuffer. - (setq-local completion-ignore-case c-i-c)) + (setq-local completion-ignore-case c-i-c) + ;; Show the completion help eagerly if + ;; `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)) + (fun (completion-metadata-get md 'eager-display))) + (when (or fun (eq completion-eager-display t)) + (funcall (if (functionp fun) + fun #'minibuffer-completion-help)))))) (read-from-minibuffer prompt initial-input keymap nil hist def inherit-input-method)))) (when (and (equal result "") def) @@ -5005,11 +5052,9 @@ minibuffer-complete-history (lambda () (get-buffer-window "*Completions*" 0)))) (completion-in-region (minibuffer--completion-prompt-end) (point-max) - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (display-sort-function . identity) - (cycle-sort-function . identity)) - (complete-with-action action completions string pred))))))) + (completion-table-with-metadata + completions '((display-sort-function . identity) + (cycle-sort-function . identity))))))) (defun minibuffer-complete-defaults () "Complete minibuffer defaults as far as possible. @@ -5025,11 +5070,9 @@ minibuffer-complete-defaults (lambda () (get-buffer-window "*Completions*" 0)))) (completion-in-region (minibuffer--completion-prompt-end) (point-max) - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (display-sort-function . identity) - (cycle-sort-function . identity)) - (complete-with-action action completions string pred)))))) + (completion-table-with-metadata + completions '((display-sort-function . identity) + (cycle-sort-function . identity)))))) (define-key minibuffer-local-map [?\C-x up] 'minibuffer-complete-history) (define-key minibuffer-local-map [?\C-x down] 'minibuffer-complete-defaults) diff --git a/lisp/tmm.el b/lisp/tmm.el index 632e55e47a8..45afbe4a3c2 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el @@ -119,12 +119,6 @@ tmm-inactive '((t :inherit shadow)) "Face used for inactive menu items.") -(defun tmm--completion-table (items) - (lambda (string pred action) - (if (eq action 'metadata) - '(metadata (display-sort-function . identity)) - (complete-with-action action items string pred)))) - (defvar tmm--history nil) ;;;###autoload @@ -222,7 +216,9 @@ tmm-prompt (setq out (if default-item (car (nth index-of-default tmm-km-list)) - (minibuffer-with-setup-hook #'tmm-add-prompt + (minibuffer-with-setup-hook + (lambda () + (setq tmm-old-mb-map (tmm-define-keys t))) ;; tmm-km-list is reversed, because history ;; needs it in LIFO order. But default list ;; needs it in non-reverse order, so that the @@ -233,7 +229,12 @@ tmm-prompt (completing-read-default (concat gl-str " (up/down to change, PgUp to menu): ") - (tmm--completion-table tmm-km-list) nil t nil + (completion-table-with-metadata + tmm-km-list '((category . tmm) + (eager-display . tmm-add-prompt) + (display-sort-function . identity) + (cycle-sort-function . identity))) + nil t nil 'tmm--history (reverse tmm--history))))))) (if (and (stringp out) (string= "^" out)) ;; A fake choice to please the destructuring later. @@ -402,7 +403,6 @@ tmm-remove-inactive-mouse-face (defun tmm-add-prompt () (unless tmm-c-prompt (error "No active menu entries")) - (setq tmm-old-mb-map (tmm-define-keys t)) (or tmm-completion-prompt (add-hook 'completion-setup-hook #'tmm-completion-delete-prompt 'append)) @@ -458,6 +458,7 @@ tmm-shortcut (defun tmm-goto-completions () "Jump to the completions buffer." (interactive) + (tmm-add-prompt) (setq tmm-c-prompt (buffer-substring (minibuffer-prompt-end) (point-max))) ;; Clear minibuffer old contents before using *Completions* buffer for ;; selection. -- 2.45.2 --=-=-=-- From unknown Mon Jun 23 16:49:14 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Daniel Mendler Subject: bug#74616: closed (Re: bug#74616: 30.0.92; tmm always displays the *Completions* buffer) Message-ID: References: <8634iqv3o3.fsf@gnu.org> <878qt1w7c6.fsf@daniel-mendler.de> X-Gnu-PR-Message: they-closed 74616 X-Gnu-PR-Package: emacs Reply-To: 74616@debbugs.gnu.org Date: Sat, 14 Dec 2024 12:42:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1734180123-27934-1" This is a multi-part message in MIME format... ------------=_1734180123-27934-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #74616: 30.0.92; tmm always displays the *Completions* buffer which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 74616@debbugs.gnu.org. --=20 74616: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D74616 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1734180123-27934-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 74616-done) by debbugs.gnu.org; 14 Dec 2024 12:41:06 +0000 Received: from localhost ([127.0.0.1]:45828 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMRSE-0007Ez-Ey for submit@debbugs.gnu.org; Sat, 14 Dec 2024 07:41:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47928) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMRS9-0007EH-GK for 74616-done@debbugs.gnu.org; Sat, 14 Dec 2024 07:41:04 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMRS1-0001Cx-D9; Sat, 14 Dec 2024 07:40:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=gZdcuS6plhlWzuo+uS4bfQnutHcrd/BXJmbj1uOTJh0=; b=XXWIfA3ilT2u nP5jzhTCF/qdXsL57nWjr0Z5DVkmcfVYkWLPtfyXXseRd2JsIn6VBkGk8D+yNh0VPa3NFbr11XZuB uOoRnnyJCJbRLYqFAU+3SoYakRhYfrjyVnQBanjk98M5C8m4XANdYimrjHkNtvxuF8OtSwS4BMLY1 VbbA7yU4VjL4s4PvxLfoVa9ir6LxaUSHaczV/NiZMQ6EPl/5d+rJRPS2lWb3wevQCwlJRMU1mJycC 1aMDcGOIU+GVGeM3UgQvA9PBkzsFx07u+wS9Nq3mvDAF9llSuKqFUlTSz08f2e/ydE0PHFlhV1dAT LIE5OOEwRLcMVXtyicM5Dw==; Date: Sat, 14 Dec 2024 14:40:12 +0200 Message-Id: <8634iqv3o3.fsf@gnu.org> From: Eli Zaretskii To: Daniel Mendler In-Reply-To: <87pllusd3j.fsf@daniel-mendler.de> (message from Daniel Mendler on Sat, 14 Dec 2024 12:44:48 +0100) Subject: Re: bug#74616: 30.0.92; tmm always displays the *Completions* buffer 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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74616-done Cc: monnier@iro.umontreal.ca, 74616-done@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Daniel Mendler > Cc: juri@linkov.net, monnier@iro.umontreal.ca, 74616@debbugs.gnu.org > Date: Sat, 14 Dec 2024 12:44:48 +0100 > > Eli Zaretskii writes: > > >> From: Daniel Mendler > >> Cc: juri@linkov.net, monnier@iro.umontreal.ca, 74616@debbugs.gnu.org > >> Date: Wed, 11 Dec 2024 16:37:18 +0100 > >> > >> > Thanks. This LGTM (but let's leave some time for others to chime in), > >> > with the following nit: > >> > > >> >> ++++ > >> >> +*** New user option 'completion-eager-display'. > >> >> +This option configures whether completion commands should display > >> >> +the *Completions* buffer immediately. When the variable is set to t all > >> >> +completion commands show *Completions* immediately, respectively nil > >> >> +disables the eager display for all commands. The default setting auto > >> > ^^ > >> > Two spaces there, please. > >> > >> Thanks. Updated patch attached. > > > > Thanks. I was about to install this, but it turns out it breaks > > minibuffer-tests: > > 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. Thanks, now installed on the master branch, and closing the bug. ------------=_1734180123-27934-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 30 Nov 2024 06:42:40 +0000 Received: from localhost ([127.0.0.1]:45184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHHBg-0005CS-8T for submit@debbugs.gnu.org; Sat, 30 Nov 2024 01:42:40 -0500 Received: from lists.gnu.org ([209.51.188.17]:55206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHHBd-0005CH-Np for submit@debbugs.gnu.org; Sat, 30 Nov 2024 01:42:38 -0500 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 1tHHBd-0007Hr-9p for bug-gnu-emacs@gnu.org; Sat, 30 Nov 2024 01:42:37 -0500 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1] helo=mail.qxqx.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tHHBb-0002w8-Uw for bug-gnu-emacs@gnu.org; Sat, 30 Nov 2024 01:42:37 -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: Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=1KTvNfVKXXFtzGgvwrhIfjqjLxsSmv6cBhX8iCOo6N0=; b=ateYEtE3gN/MeQVvcJvYDDKMt8 edwIP/fBlA6WEBVp+eX9AEwsS14JdwQSYuH4Ywx/uCnxjjk4U+k0bTPEeXmBsTo9LVxnXgtXBDDxs HGRNPokkAMWlQ/KslbYifkD17Q1xIPfqUVkl0Id1bDLqKHqx22S1yuu9WjS/t61YpnFY=; From: Daniel Mendler To: bug-gnu-emacs@gnu.org Subject: 30.0.92; tmm always displays the *Completions* buffer X-Debbugs-Cc: Stefan Monnier Date: Sat, 30 Nov 2024 07:42:33 +0100 Message-ID: <878qt1w7c6.fsf@daniel-mendler.de> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a01:4f8:c012:9177::1; envelope-from=mail@daniel-mendler.de; helo=mail.qxqx.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) The `tmm-add-prompt' function of tmm.el automatically displays the *Completions* buffer by calling `minibuffer-completion-help'. If an alternative minibuffer completion system like Icomplete or Vertico is used, the *Completions* buffer is not needed since the candidates are already displayed in the minibuffer. I propose to either detect these alternative completion systems (e.g., by checking the value of the completing-read-function and/or the mode variables) or to provide a new customization variable `tmm-display-completions' which defaults to t but can be set to nil to disable the call to `minibuffer-completion-help'. I am happy to provide a patch for either of these approaches. ------------=_1734180123-27934-1-- From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Dec 2024 07:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Daniel Mendler Cc: Eli Zaretskii , 74616@debbugs.gnu.org, monnier@iro.umontreal.ca Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.173424896225190 (code B ref 74616); Sun, 15 Dec 2024 07:50:02 +0000 Received: (at 74616) by debbugs.gnu.org; 15 Dec 2024 07:49:22 +0000 Received: from localhost ([127.0.0.1]:49461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMjNR-0006YD-Hf for submit@debbugs.gnu.org; Sun, 15 Dec 2024 02:49:21 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:57173) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMjNP-0006Xs-26 for 74616@debbugs.gnu.org; Sun, 15 Dec 2024 02:49:19 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 5321EFF804; Sun, 15 Dec 2024 07:48:50 +0000 (UTC) From: Juri Linkov In-Reply-To: <87pllusd3j.fsf@daniel-mendler.de> (Daniel Mendler's message of "Sat, 14 Dec 2024 12:44:48 +0100") Organization: LINKOV.NET 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> Date: Sun, 15 Dec 2024 09:44:00 +0200 Message-ID: <87o71d2xxb.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > 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: Debugger entered--Lisp error: (wrong-type-argument stringp ("/tmp/file" . 6)) completion--embedded-envvar-table(("/tmp/file" . 6) file-exists-p metadata) complete-with-action(metadata completion--embedded-envvar-table ("/tmp/file" . 6) file-exists-p) read-file-name-internal(("/tmp/file" . 6) file-exists-p metadata) completion-metadata(("/tmp/file" . 6) read-file-name-internal file-exists-p) minibuffer-setup() completing-read-default("Find file or URL: " read-file-name-internal file-exists-p nil ("/tmp/file" . 5) file-name-history "/tmp/file" nil) read-file-name-default("Find file or URL: " "/tmp/" nil nil "file" nil) read-file-name("Find file or URL: " "/tmp/" nil nil "file") ffap-read-file-or-url("Find file or URL: " "./file") ffap-prompter() ffap() funcall-interactively(ffap) command-execute(ffap record) execute-extended-command(nil "ffap" "ffap") funcall-interactively(execute-extended-command nil "ffap" "ffap") command-execute(execute-extended-command) From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Dec 2024 10:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: Eli Zaretskii , 74616@debbugs.gnu.org, monnier@iro.umontreal.ca Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.173425709117058 (code B ref 74616); Sun, 15 Dec 2024 10:05:01 +0000 Received: (at 74616) by debbugs.gnu.org; 15 Dec 2024 10:04:50 +0000 Received: from localhost ([127.0.0.1]:49610 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMlUY-0004R4-Ff for submit@debbugs.gnu.org; Sun, 15 Dec 2024 05:04:50 -0500 Received: from server.qxqx.de ([49.12.34.165]:39097 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMlUW-0004Qr-Be for 74616@debbugs.gnu.org; Sun, 15 Dec 2024 05:04:49 -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=auXBX8holSQtvSUwwvHXjC3xZDXe+RQ+BNVlVc1PZOA=; b=c3rd9GvIOWaq1II4NJEPZI8Ns8 /TBULOWYjPNXrWKDdG9skSvOp/Rj4NbVQLl0lsEJpG7HbURojsF70fx3dUVin92gw3yw2cunUR537 33zEWIxEl17Ru8MSeIJdbCcRvzKafi+tRX5niKAHhfIs9AeqxsfUWqEjGtSBfKaNRKFg=; From: Daniel Mendler In-Reply-To: <87o71d2xxb.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 15 Dec 2024 09:44:00 +0200") 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> Date: Sun, 15 Dec 2024 11:02:29 +0100 Message-ID: <87bjxdfemi.fsf@daniel-mendler.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain 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. Daniel --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-completion-eager-display-Handle-INITIAL-INPUT-cons.patch >From 234fbf9b2e05c73b6197f4db9e88c694e54a95a2 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Sun, 15 Dec 2024 10:57:59 +0100 Subject: [PATCH] completion-eager-display: Handle INITIAL-INPUT cons The INITIAL-ARGUMENT passed to `completing-read' can either be nil, or a string or a pair (STRING . POSITION). Handle each of these three cases. * lisp/minibuffer.el (completing-read-default): Handle cons pair INITIAL-ARGUMENT. --- lisp/minibuffer.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index dfc62c25f38..9a8545c56a6 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -4857,8 +4857,12 @@ 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 + (pcase initial-input + (`(,str . ,pos) (substring str 0 pos)) + ((pred stringp) initial-input) + (_ "")) + collection predicate)) (fun (completion-metadata-get md 'eager-display))) (when (or fun (eq completion-eager-display t)) (funcall (if (functionp fun) -- 2.45.2 --=-=-=-- From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer 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 X-GNU-PR-Keywords: To: Juri Linkov Cc: Eli Zaretskii , 74616@debbugs.gnu.org, monnier@iro.umontreal.ca Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.173427657313985 (code B ref 74616); Sun, 15 Dec 2024 15:30:01 +0000 Received: (at 74616) by debbugs.gnu.org; 15 Dec 2024 15:29:33 +0000 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 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=; From: Daniel Mendler In-Reply-To: <87bjxdfemi.fsf@daniel-mendler.de> (Daniel Mendler's message of "Sun, 15 Dec 2024 11:02:29 +0100") 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> Date: Sun, 15 Dec 2024 16:29:19 +0100 Message-ID: <874j359d80.fsf@daniel-mendler.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= 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 --=-=-=-- From unknown Mon Jun 23 16:49:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#74616: 30.0.92; tmm always displays the *Completions* buffer Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Dec 2024 23:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Daniel Mendler Cc: Eli Zaretskii , 74616@debbugs.gnu.org, Juri Linkov Received: via spool by 74616-submit@debbugs.gnu.org id=B74616.17343038912062 (code B ref 74616); Sun, 15 Dec 2024 23:05:02 +0000 Received: (at 74616) by debbugs.gnu.org; 15 Dec 2024 23:04:51 +0000 Received: from localhost ([127.0.0.1]:52565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMxfP-0000XB-A7 for submit@debbugs.gnu.org; Sun, 15 Dec 2024 18:04:51 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:45050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMxfM-0000Ws-9P for 74616@debbugs.gnu.org; Sun, 15 Dec 2024 18:04:48 -0500 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 7592E80013; Sun, 15 Dec 2024 18:04:42 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1734303881; bh=JR139y+fJz2/GOSU+OxbeVFd/+KkvrAlYzGtxWPpHFs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=imywglC+8kGaVAFerZkY9IMRKrQIj9d2hB642SIfK+Ffa1akeRjKbCvPMPhQk+xVs MG0WhFZgLCWx8Y/7pTdtQVnM69G33WcFE95drglzvGCCME0LYtdWTucmqoNtXw0hsb 9c7oGlN2IyDjISoIjtJVVO1yzKzX3sbWjrTk0a6Re9zU9J1Z7ulPumnmunDXz9g3yN rRamAVdfMwZsoTc8zo33O9gJOSejnwoXpqMNSPEO9mPQsiKWInhQrWLq9SNy1CZfgf vjin0vYqAB0nF1bFghQeLCMDNldXFF2TZC1CEgR44mfY8aENw80M16Pl62AeYw3k4Y aWBM6ZiYsiW/A== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 89CE6805DC; Sun, 15 Dec 2024 18:04:41 -0500 (EST) Received: from pastel (104-195-225-43.cpe.teksavvy.com [104.195.225.43]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 56C1B12045A; Sun, 15 Dec 2024 18:04:41 -0500 (EST) From: Stefan Monnier In-Reply-To: <874j359d80.fsf@daniel-mendler.de> (Daniel Mendler's message of "Sun, 15 Dec 2024 16:29:19 +0100") Message-ID: 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> <874j359d80.fsf@daniel-mendler.de> Date: Sun, 15 Dec 2024 18:04:40 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.040 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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. Thanks, pushed to `master`. Stefan