From unknown Sun Aug 17 22:05:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Mar 2025 15:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 77253 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 77253@debbugs.gnu.org Cc: juri@linkov.net X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17429154724859 (code B ref -1); Tue, 25 Mar 2025 15:12:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Mar 2025 15:11:12 +0000 Received: from localhost ([127.0.0.1]:39633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tx5vs-0001GJ-AB for submit@debbugs.gnu.org; Tue, 25 Mar 2025 11:11:12 -0400 Received: from lists.gnu.org ([2001:470:142::17]:49270) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tx5vn-0001Ff-SV for submit@debbugs.gnu.org; Tue, 25 Mar 2025 11:11:10 -0400 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 1tx5vh-00043c-I0 for bug-gnu-emacs@gnu.org; Tue, 25 Mar 2025 11:11:01 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tx5vf-0007rB-GB for bug-gnu-emacs@gnu.org; Tue, 25 Mar 2025 11:11:01 -0400 From: Spencer Baugh Date: Tue, 25 Mar 2025 11:10:57 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1742915457; bh=FKoIdbeyg0teG/4idUqUhvYMZzcg4b6KvhPf+kNLWFc=; h=From:To:Cc:Subject:Date; b=NuGhRy1jpZi+830BVTy98Hik2JkNlxSOKgH7D7n6g9E21YrKIYJuhegbQvPPl+FAd 6I8TekR0p3z2B+7cl9MGSqfnBT3GzN3Cpiqtb2oxLX5x62+dtliJmPJk+BjLSKys1s wS2pS+cErd2X8gS92BPPD0MpcmVD+AUPjShzelcLYmQ8yx/cSdeU+8fPSCFhw5plQZ Gfz534mQJgVv30f2To3t1XeScO5yLR6uo+PkS6UkT7VXMo60olIcrhkVjWTqYok+om kmNjHxi7OG84JOQ0HhQlff4n7WNrBUg98nAaroCtB4y1su5VmALqYL7xlUgI91w5gN JNBeXZoowUj5w== Received-SPF: pass client-ip=64.215.233.18; envelope-from=sbaugh@janestreet.com; helo=mxout5.mail.janestreet.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) 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: -0.1 (/) Right now, minibuffer-visible-completions does two things, only when *Completions* is visible: A. If there's a selected completion candidate, RET exits the minibuffer with it. B. The arrow keys move point in the *Completions* buffer instead of the minibuffer, to select completion candidates. These are really two separate things. A is a nice behavior for novice users, but B is difficult for novice users (who like to use the arrow keys for moving point) to deal with. We should make them separately configurable, or at least allow enabling the RET behavior without the arrow keys behavior. And with the addition of completion-auto-deselect, the RET behavior is actually a plausible default behavior: it only takes effect if the user has manually selected a completion candidate with M-/M-, and the selected candidate is automatically deselected if the user types more. So it won't affect anyone who isn't explicitly making use of M-/M-. So I suggest we should add a new defcustom to change the RET behavior in the presence of a selected completion candidate, and default it to t. From unknown Sun Aug 17 22:05:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Mar 2025 17:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77253 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Spencer Baugh Cc: 77253@debbugs.gnu.org X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.174292336730283 (code B ref -1); Tue, 25 Mar 2025 17:23:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Mar 2025 17:22:47 +0000 Received: from localhost ([127.0.0.1]:39857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tx7zC-0007sN-Ub for submit@debbugs.gnu.org; Tue, 25 Mar 2025 13:22:47 -0400 Received: from lists.gnu.org ([2001:470:142::17]:38064) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tx7yu-0007rG-91 for submit@debbugs.gnu.org; Tue, 25 Mar 2025 13:22:28 -0400 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 1tx7yU-0003F8-2O for bug-gnu-emacs@gnu.org; Tue, 25 Mar 2025 13:22:02 -0400 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tx7yQ-0008Pa-9D for bug-gnu-emacs@gnu.org; Tue, 25 Mar 2025 13:22:00 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id A2D86442B0; Tue, 25 Mar 2025 17:21:52 +0000 (UTC) From: Juri Linkov In-Reply-To: Organization: LINKOV.NET References: Date: Tue, 25 Mar 2025 19:19:38 +0200 Message-ID: <87jz8d6n9x.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-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduieefvdefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepvddprhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhgpdhrtghpthhtohepshgsrghughhhsehjrghnvghsthhrvggvthdrtghomh X-GND-Sasl: juri@linkov.net Received-SPF: pass client-ip=2001:4b98:dc4:8::226; envelope-from=juri@linkov.net; helo=relay6-d.mail.gandi.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: -0.3 (/) > Right now, minibuffer-visible-completions does two things, only when > *Completions* is visible: > > A. If there's a selected completion candidate, RET exits the minibuffer > with it. > > B. The arrow keys move point in the *Completions* buffer instead of the > minibuffer, to select completion candidates. > > These are really two separate things. > > A is a nice behavior for novice users, but B is difficult for novice > users (who like to use the arrow keys for moving point) to deal with. Not sure why this would be difficult for novice users, but maybe adding a new value to the existing defcustom minibuffer-visible-completions would be sufficient? From unknown Sun Aug 17 22:05:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Mar 2025 17:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77253 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: 77253@debbugs.gnu.org Received: via spool by 77253-submit@debbugs.gnu.org id=B77253.174292351830961 (code B ref 77253); Tue, 25 Mar 2025 17:26:02 +0000 Received: (at 77253) by debbugs.gnu.org; 25 Mar 2025 17:25:18 +0000 Received: from localhost ([127.0.0.1]:39866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tx81d-00083C-Tv for submit@debbugs.gnu.org; Tue, 25 Mar 2025 13:25:18 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:54509) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tx81b-0007xe-IJ for 77253@debbugs.gnu.org; Tue, 25 Mar 2025 13:25:16 -0400 From: Spencer Baugh In-Reply-To: <87jz8d6n9x.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 25 Mar 2025 19:19:38 +0200") References: <87jz8d6n9x.fsf@mail.linkov.net> Date: Tue, 25 Mar 2025 13:25:09 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1742923510; bh=g7lVT5an1bwz1+cLQwI4TgdxPyjpWXrBmdCMEffhEeg=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=a8H+Q+Ge+ZCFgNvuNLujioAzFnmLIaejY9+l5MKV0HeGP+Sla1kddN7SsAvpJyKa1 KDbabr7uIUUNvHDfZzUgoa+5vlEfyub+eFgM5iiQEVCECF8aynKXPDvoStBuP/IO0A nqXoedhIKX+bejVBYKrxfgXjs1OVEzGfXJxzZguBxmQHPMPRfG0b6tsZDvdy2iNIUy uoAB5eKBtG3MBX8oF7bL7V1xXu7NrzCa+7WjL3Y7xafF6WxeQ7CnjS99ZWDLH+QTda YUotANgY7wgMGPaQT5g6YtVeoWBqlEXn/cRHetG6Q5AfzSb1RCHXvfNQ/Vs8qacvDs AD6Ej+kWOveuQ== 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 (---) Juri Linkov writes: >> Right now, minibuffer-visible-completions does two things, only when >> *Completions* is visible: >> >> A. If there's a selected completion candidate, RET exits the minibuffer >> with it. >> >> B. The arrow keys move point in the *Completions* buffer instead of the >> minibuffer, to select completion candidates. >> >> These are really two separate things. >> >> A is a nice behavior for novice users, but B is difficult for novice >> users (who like to use the arrow keys for moving point) to deal with. > > Not sure why this would be difficult for novice users, Well, because they like using the arrow keys. :) > but maybe adding a new value to the existing defcustom > minibuffer-visible-completions would be sufficient? That would work, but I guess I also propose that we should change the implementation a bit. The use of a menu-item :filter binding is clever, but I think it would be nicer to have a normal binding for RET which just checks if *Completions* is shown/a completion candidate is selected. For one thing, then C-h k RET will behave more expectedly. From unknown Sun Aug 17 22:05:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Mar 2025 07:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77253 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Spencer Baugh Cc: 77253@debbugs.gnu.org Received: via spool by 77253-submit@debbugs.gnu.org id=B77253.174297561212083 (code B ref 77253); Wed, 26 Mar 2025 07:54:01 +0000 Received: (at 77253) by debbugs.gnu.org; 26 Mar 2025 07:53:32 +0000 Received: from localhost ([127.0.0.1]:41125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1txLZs-00038p-Bd for submit@debbugs.gnu.org; Wed, 26 Mar 2025 03:53:32 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:51845) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1txLZo-00038V-Mo for 77253@debbugs.gnu.org; Wed, 26 Mar 2025 03:53:30 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 44421443D6; Wed, 26 Mar 2025 07:53:20 +0000 (UTC) From: Juri Linkov In-Reply-To: Organization: LINKOV.NET References: <87jz8d6n9x.fsf@mail.linkov.net> Date: Wed, 26 Mar 2025 09:52:05 +0200 Message-ID: <87ldssz0t6.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-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduieegleekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepvddprhgtphhtthhopeejjedvheefseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepshgsrghughhhsehjrghnvghsthhrvggvthdrtghomh 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 (-) >>> Right now, minibuffer-visible-completions does two things, only when >>> *Completions* is visible: >>> >>> A. If there's a selected completion candidate, RET exits the minibuffer >>> with it. >>> >>> B. The arrow keys move point in the *Completions* buffer instead of the >>> minibuffer, to select completion candidates. >>> >>> These are really two separate things. >>> >>> A is a nice behavior for novice users, but B is difficult for novice >>> users (who like to use the arrow keys for moving point) to deal with. >> >> Not sure why this would be difficult for novice users, > > Well, because they like using the arrow keys. :) But they like using the arrow keys to select a completion candidate too. This is how they use arrow keys e.g. in a web browser in the address bar. At least up/down arrows navigate completions, while left/right arrows indeed move the cursor in the address bar. So we need separate values for up/down and left/right arrows? >> but maybe adding a new value to the existing defcustom >> minibuffer-visible-completions would be sufficient? > > That would work, but I guess I also propose that we should change the > implementation a bit. The use of a menu-item :filter binding is clever, > but I think it would be nicer to have a normal binding for RET which > just checks if *Completions* is shown/a completion candidate is > selected. For one thing, then C-h k RET will behave more expectedly. Removing the :filter binding would be fine, if it won't cause other problems. At least it would be nice to try to see how this works with :filter. From unknown Sun Aug 17 22:05:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Mar 2025 14:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77253 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: 77253@debbugs.gnu.org Received: via spool by 77253-submit@debbugs.gnu.org id=B77253.174299799424176 (code B ref 77253); Wed, 26 Mar 2025 14:07:02 +0000 Received: (at 77253) by debbugs.gnu.org; 26 Mar 2025 14:06:34 +0000 Received: from localhost ([127.0.0.1]:43761 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1txROs-0006Hr-1s for submit@debbugs.gnu.org; Wed, 26 Mar 2025 10:06:34 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:51397) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1txROk-0006HR-TQ for 77253@debbugs.gnu.org; Wed, 26 Mar 2025 10:06:28 -0400 From: Spencer Baugh In-Reply-To: <87ldssz0t6.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 26 Mar 2025 09:52:05 +0200") References: <87jz8d6n9x.fsf@mail.linkov.net> <87ldssz0t6.fsf@mail.linkov.net> Date: Wed, 26 Mar 2025 10:06:20 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1742997980; bh=O+PbwiKq83U1OKzlNZxjF8JN6p/YIb18+v4A5zwnUgM=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=M9eWJ+Fqt2RVSjD/C4igeuGbd2Oixuflbx5zvkQxKaYZrBmPmuTIdP7rj4Kbu76L2 vb3mLyUYbLSSaasc+m4vtxw2FkMx52+iM32ZK8M2u8jX6Gbr3jNv1RfNbtUkTZCUJb BQuHtUrwMFG5nEsk/USKb+wneOlBYRuclUUNfQ2zGRFSpVfbHQzXVa3CCaIj160DFi CQMZYfZE1b4lb5JT7MQnrpeyO2dFVkru++kVKZXNaaXNYKnPvRGbE0ZHJdDPYXSsbu OkkAe33yBgDldB6BcnwQcXITjuCKlqEvoH5Ld1QrHCAnGyTkfdwRevzzDI5EwL4nxS 1Xs+aHR2/zcYg== 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 (---) Juri Linkov writes: >>>> Right now, minibuffer-visible-completions does two things, only when >>>> *Completions* is visible: >>>> >>>> A. If there's a selected completion candidate, RET exits the minibuffer >>>> with it. >>>> >>>> B. The arrow keys move point in the *Completions* buffer instead of the >>>> minibuffer, to select completion candidates. >>>> >>>> These are really two separate things. >>>> >>>> A is a nice behavior for novice users, but B is difficult for novice >>>> users (who like to use the arrow keys for moving point) to deal with. >>> >>> Not sure why this would be difficult for novice users, >> >> Well, because they like using the arrow keys. :) > > But they like using the arrow keys to select a completion candidate too. > This is how they use arrow keys e.g. in a web browser in the address bar. > At least up/down arrows navigate completions, while left/right arrows > indeed move the cursor in the address bar. That is true. > So we need separate values for up/down and left/right arrows? That would probably be good, yes. But, here's another factor: The *Completions* buffer by default contains a help message explaining to users that they can use M- and M- to select completions. There's no such message explaining to users that they can use C-b/C-f/C-n/C-p to move point. So: - If the arrow keys move point, users can still figure out how to select completions by reading the help text. - If the arrow keys select completions, users who don't know C-b/C-f/C-n/C-p are basically helpless. (This is sadly common at my site, because most of our users use evil-mode and don't know C-b/C-f/C-n/C-p) Also, rebinding the arrow keys by default to select completions is probably an unacceptable behavior change. But it's very possible to rebind RET to accept completions by default. So even if we disregard the "novice user" argument, I still think we should investigate binding RET without rebinding the arrow keys. >>> but maybe adding a new value to the existing defcustom >>> minibuffer-visible-completions would be sufficient? >> >> That would work, but I guess I also propose that we should change the >> implementation a bit. The use of a menu-item :filter binding is clever, >> but I think it would be nicer to have a normal binding for RET which >> just checks if *Completions* is shown/a completion candidate is >> selected. For one thing, then C-h k RET will behave more expectedly. > > Removing the :filter binding would be fine, if it won't cause other problems. > At least it would be nice to try to see how this works with :filter. I'm curious: Why do you prefer the :filter approach? Does it avoid some problems that happened in the past? It makes sense for the arrow keys, but if we are rebinding RET by default, :filter seems like an unusual thing to use. From unknown Sun Aug 17 22:05:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Mar 2025 18:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77253 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Spencer Baugh Cc: 77253@debbugs.gnu.org Received: via spool by 77253-submit@debbugs.gnu.org id=B77253.174309843525932 (code B ref 77253); Thu, 27 Mar 2025 18:01:02 +0000 Received: (at 77253) by debbugs.gnu.org; 27 Mar 2025 18:00:35 +0000 Received: from localhost ([127.0.0.1]:51254 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1txrWs-0006kA-MW for submit@debbugs.gnu.org; Thu, 27 Mar 2025 14:00:35 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:59499) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1txrWY-0006eP-TS for 77253@debbugs.gnu.org; Thu, 27 Mar 2025 14:00:15 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 4CF05441B4; Thu, 27 Mar 2025 18:00:06 +0000 (UTC) From: Juri Linkov In-Reply-To: Organization: LINKOV.NET References: <87jz8d6n9x.fsf@mail.linkov.net> <87ldssz0t6.fsf@mail.linkov.net> Date: Thu, 27 Mar 2025 19:50:13 +0200 Message-ID: <87r02iuzni.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-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduieeltdejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepvddprhgtphhtthhopeejjedvheefseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepshgsrghughhhsehjrghnvghsthhrvggvthdrtghomh 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 (-) > But, here's another factor: The *Completions* buffer by default contains > a help message explaining to users that they can use M- and M- > to select completions. There's no such message explaining to users that > they can use C-b/C-f/C-n/C-p to move point. So: > > - If the arrow keys move point, users can still figure out how to select > completions by reading the help text. > > - If the arrow keys select completions, users who don't know > C-b/C-f/C-n/C-p are basically helpless. (This is sadly common at my > site, because most of our users use evil-mode and don't know > C-b/C-f/C-n/C-p) When users need to move point with arrow keys, then they have to close the completions window. This is the purpose of 'minibuffer-visible-completions': to eliminate ambiguity whether arrows/RET apply to the visible completions window, or to the text in the minibuffer. > Also, rebinding the arrow keys by default to select completions is > probably an unacceptable behavior change. But it's very possible to > rebind RET to accept completions by default. So even if we disregard > the "novice user" argument, I still think we should investigate binding > RET without rebinding the arrow keys. Not sure if it's possible for RET to accept the selected candidate by default since users might prefer to accept text in the minibuffer. > I'm curious: Why do you prefer the :filter approach? Does it avoid some > problems that happened in the past? It makes sense for the arrow keys, > but if we are rebinding RET by default, :filter seems like an unusual > thing to use. :filter makes it easier to add conditional keybindings that share the same condition. I doubt if it would be possible to rebind RET by default. But need to try to see how it works. From unknown Sun Aug 17 22:05:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Mar 2025 20:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77253 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: 77253@debbugs.gnu.org Received: via spool by 77253-submit@debbugs.gnu.org id=B77253.17431081586324 (code B ref 77253); Thu, 27 Mar 2025 20:43:02 +0000 Received: (at 77253) by debbugs.gnu.org; 27 Mar 2025 20:42:38 +0000 Received: from localhost ([127.0.0.1]:51553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1txu3i-0001dv-0u for submit@debbugs.gnu.org; Thu, 27 Mar 2025 16:42:38 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:49263) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1txu3f-0001df-TB for 77253@debbugs.gnu.org; Thu, 27 Mar 2025 16:42:36 -0400 From: Spencer Baugh In-Reply-To: <87r02iuzni.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 27 Mar 2025 19:50:13 +0200") References: <87jz8d6n9x.fsf@mail.linkov.net> <87ldssz0t6.fsf@mail.linkov.net> <87r02iuzni.fsf@mail.linkov.net> Date: Thu, 27 Mar 2025 16:42:29 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1743108150; bh=fiZpxrYqvnjHmKJU46meSyUYMr+6BD/2w8j9hT6JKBQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=wr+dNUmOPhyfG3arHDtVR2Fkx8swYz7sU6DovPxp7QiEFb8/BvHr/s0yjg00BY/PH huJcc9jmN+F7NqwCE48IUk2X5LUpiinxXGYbXPaRrJ9g9tVqHNuexaYfW91aRUhpM8 cOVDO+xfWi/QO78HfMFSxeTTeTJTZ7wO5RO0oesXDeCsqUHB4ZjzRbFvuaTNpioLab bbI06m/9PxvrRRtl07bLsSGtYw9/1klmo7iuksKDu/s95RWKfo4XFSzpMMiVbEntEF DtG4e22ZV8t1Fa4L9/zUxtdV8tvGDZXU5LTAxedto1IeA6xuApOlqdpTNXbhphVscq QiWI4idTv1XyA== 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 (---) Juri Linkov writes: >> But, here's another factor: The *Completions* buffer by default contains >> a help message explaining to users that they can use M- and M- >> to select completions. There's no such message explaining to users that >> they can use C-b/C-f/C-n/C-p to move point. So: >> >> - If the arrow keys move point, users can still figure out how to select >> completions by reading the help text. >> >> - If the arrow keys select completions, users who don't know >> C-b/C-f/C-n/C-p are basically helpless. (This is sadly common at my >> site, because most of our users use evil-mode and don't know >> C-b/C-f/C-n/C-p) > > When users need to move point with arrow keys, then they have > to close the completions window. This is the purpose of > 'minibuffer-visible-completions': to eliminate ambiguity > whether arrows/RET apply to the visible completions window, > or to the text in the minibuffer. Yes, and I'm definitely a fan of minibuffer-visible-completions, but just to name a few problems: - It's not necessarily obvious that closing the completions window will make the arrow keys operate in the minibuffer. Actually, maybe we should update the completion help text to say that? That might help a lot. - The new completion-eager-display makes *Completions* pop up immediately; when this happens, it can be surprising that the arrow keys don't work in the minibuffer from the very start of the minibuffer session. But again, I like minibuffer-visible-completions a lot, I'm just wondering about other points in the design space. >> Also, rebinding the arrow keys by default to select completions is >> probably an unacceptable behavior change. But it's very possible to >> rebind RET to accept completions by default. So even if we disregard >> the "novice user" argument, I still think we should investigate binding >> RET without rebinding the arrow keys. > > Not sure if it's possible for RET to accept the selected candidate > by default since users might prefer to accept text in the minibuffer. If there's a selected candidate, though, then users have already decided to use M-/M- to interact with completions. (Or they've switched to the completions buffer and selected one) If they decide they don't want the candidate they selected, and want to continue with text in the minibuffer, completion-auto-deselect will automatically deselect the candidate if they type anything. I think these two facts combined make it possible for RET to accept the selected candidate by default. >> I'm curious: Why do you prefer the :filter approach? Does it avoid some >> problems that happened in the past? It makes sense for the arrow keys, >> but if we are rebinding RET by default, :filter seems like an unusual >> thing to use. > > :filter makes it easier to add conditional keybindings that share > the same condition. I doubt if it would be possible to rebind RET > by default. But need to try to see how it works. Makes sense. I'll try. From unknown Sun Aug 17 22:05:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Mar 2025 07:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77253 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Spencer Baugh Cc: 77253@debbugs.gnu.org Received: via spool by 77253-submit@debbugs.gnu.org id=B77253.17431471498917 (code B ref 77253); Fri, 28 Mar 2025 07:33:02 +0000 Received: (at 77253) by debbugs.gnu.org; 28 Mar 2025 07:32:29 +0000 Received: from localhost ([127.0.0.1]:52613 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ty4Ca-0002Jl-Ob for submit@debbugs.gnu.org; Fri, 28 Mar 2025 03:32:29 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:40979) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ty4CY-0002JS-CZ for 77253@debbugs.gnu.org; Fri, 28 Mar 2025 03:32:27 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id DBEBA442A7; Fri, 28 Mar 2025 07:32:16 +0000 (UTC) From: Juri Linkov In-Reply-To: Organization: LINKOV.NET References: <87jz8d6n9x.fsf@mail.linkov.net> <87ldssz0t6.fsf@mail.linkov.net> <87r02iuzni.fsf@mail.linkov.net> Date: Fri, 28 Mar 2025 09:20:43 +0200 Message-ID: <87ecyhskhg.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-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddujedtjedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepvddprhgtphhtthhopeejjedvheefseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepshgsrghughhhsehjrghnvghsthhrvggvthdrtghomh 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 (-) > - It's not necessarily obvious that closing the completions window will > make the arrow keys operate in the minibuffer. Actually, maybe we > should update the completion help text to say that? That might help a > lot. Maybe it's possible to squeeze this help text just into one additional line? Something like: Type 'C-g' to close this window and restore arrows to move point. > - The new completion-eager-display makes *Completions* pop up > immediately; when this happens, it can be surprising that the arrow > keys don't work in the minibuffer from the very start of the > minibuffer session. Then another possible value for 'minibuffer-visible-completions' would be to not rebind left/right arrows when the completions window contains only one column (like on the browser's address bar). >> Not sure if it's possible for RET to accept the selected candidate >> by default since users might prefer to accept text in the minibuffer. > > If there's a selected candidate, though, then users have already decided > to use M-/M- to interact with completions. (Or they've > switched to the completions buffer and selected one) > > If they decide they don't want the candidate they selected, and want to > continue with text in the minibuffer, completion-auto-deselect will > automatically deselect the candidate if they type anything. > > I think these two facts combined make it possible for RET to accept the > selected candidate by default. Makes sense. So we need to try how well it performs. From unknown Sun Aug 17 22:05:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Apr 2025 17:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77253 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: 77253@debbugs.gnu.org Received: via spool by 77253-submit@debbugs.gnu.org id=B77253.17437027734187 (code B ref 77253); Thu, 03 Apr 2025 17:53:02 +0000 Received: (at 77253) by debbugs.gnu.org; 3 Apr 2025 17:52:53 +0000 Received: from localhost ([127.0.0.1]:35562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u0OkG-00015S-Cs for submit@debbugs.gnu.org; Thu, 03 Apr 2025 13:52:52 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:36595) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u0OkD-00015D-My for 77253@debbugs.gnu.org; Thu, 03 Apr 2025 13:52:50 -0400 From: Spencer Baugh In-Reply-To: <87ecyhskhg.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 28 Mar 2025 09:20:43 +0200") References: <87jz8d6n9x.fsf@mail.linkov.net> <87ldssz0t6.fsf@mail.linkov.net> <87r02iuzni.fsf@mail.linkov.net> <87ecyhskhg.fsf@mail.linkov.net> Date: Thu, 03 Apr 2025 13:52:44 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1743702764; bh=IwG+066TPCnGbIUj5oVYvwIL/r5ZEzyjdSnmXWkZkuY=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=kC7d2EFaJb62T+I+bgpktH+Eupa0TerdLgTzfQbDsDZOjmVLTcou1uZuG40xdWnjT xbV/XucWw0SH43droahnud914ELprjVtxm9gX7y2TE9qIvclTTV/T0AOf1kVbzw+cT cjGiIR74jORMfAR9QyeiJXLSYjeRPDhgv662rqBnNcoZE+kn25AYO5kwVOSNT80VsE M4iISCKIlP/UstE6UQ3nikfk+ME0fAq92iJqJCdzuK0mNdY5EInohXmQJsGf7c5km4 3ljJQ2rn6b5eUnzVqZsr365jQTEzKsQ8We64rrP2lHMopCVna5zSgUuKtCH5kFsRBN EBVVxWuUr/opg== 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 (---) Juri Linkov writes: >> - It's not necessarily obvious that closing the completions window will >> make the arrow keys operate in the minibuffer. Actually, maybe we >> should update the completion help text to say that? That might help a >> lot. > > Maybe it's possible to squeeze this help text just into one additional line? > Something like: > > Type 'C-g' to close this window and restore arrows to move point. Maybe we don't even need an additional line? How about: Click or type RET on a completion to select it, or C-g to close this window. Type , , , to move point between completions. >> - The new completion-eager-display makes *Completions* pop up >> immediately; when this happens, it can be surprising that the arrow >> keys don't work in the minibuffer from the very start of the >> minibuffer session. > > Then another possible value for 'minibuffer-visible-completions' > would be to not rebind left/right arrows when the completions window > contains only one column (like on the browser's address bar). True. Though I guess that could maybe be the default behavior when completions-format=one-column. >>> Not sure if it's possible for RET to accept the selected candidate >>> by default since users might prefer to accept text in the minibuffer. >> >> If there's a selected candidate, though, then users have already decided >> to use M-/M- to interact with completions. (Or they've >> switched to the completions buffer and selected one) >> >> If they decide they don't want the candidate they selected, and want to >> continue with text in the minibuffer, completion-auto-deselect will >> automatically deselect the candidate if they type anything. >> >> I think these two facts combined make it possible for RET to accept the >> selected candidate by default. > > Makes sense. So we need to try how well it performs. How about this? (BTW, after writing minibuffer--completions-visible, I'm wondering if most of the code which calls (get-buffer-window "*Completions*" 0) is actually buggy, because it's not checking completion-reference-buffer. Should we replace ~all the calls to (get-buffer-window "*Completions*" 0) with (minibuffer--completions-visible) which does check that?) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 404fa143194..c026e41a818 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3209,6 +3209,12 @@ completion-help-at-point (define-key map "\n" 'exit-minibuffer) (define-key map "\r" 'exit-minibuffer)) +(defun minibuffer-choose-completion-just-exit (&optional no-exit) + "Choose the selected completion from the minibuffer or call `exit-minibuffer'." + (interactive "P") + (or (minibuffer-choose-completion-if-selected no-exit) + (minibuffer-exit))) + (defvar-keymap minibuffer-local-completion-map :doc "Local keymap for minibuffer input with completion." :parent minibuffer-local-map @@ -3218,6 +3224,7 @@ minibuffer-local-completion-map ;; another binding for it. ;; "M-TAB" #'minibuffer-force-complete "SPC" #'minibuffer-complete-word + "RET" #'minibuffer-choose-completion-just-exit "?" #'minibuffer-completion-help "" #'switch-to-completions "M-v" #'switch-to-completions @@ -3229,7 +3236,7 @@ minibuffer-local-completion-map (defvar-keymap minibuffer-local-must-match-map :doc "Local keymap for minibuffer input with completion, for exact match." :parent minibuffer-local-completion-map - "RET" #'minibuffer-complete-and-exit + "RET" #'minibuffer-choose-completion-or-exit "C-j" #'minibuffer-complete-and-exit) (defvar-keymap minibuffer-local-filename-completion-map @@ -3326,18 +3333,34 @@ minibuffer-visible-completions (defvar minibuffer-visible-completions--always-bind nil "If non-nil, force the `minibuffer-visible-completions' bindings on.") +(defun minibuffer--completions-visible () + "Return the window where the *Completions* buffer for this minibuffer is visible." + (when-let ((window (get-buffer-window "*Completions*" 0))) + (when (eq (buffer-local-value 'completion-reference-buffer + (window-buffer window)) + (window-buffer (active-minibuffer-window))) + window))) + +(defun minibuffer-choose-completion-if-selected (&optional no-exit no-quit) + "Like `minibuffer-choose-completion', but do nothing if no candidate is selected. + +Return non-nil if a completion was chosen." + (when-let* ((window (minibuffer--completions-visible))) + (with-selected-window window + ;; Detect selection as if `choose-completion-deselect-if-after' is nil. + (when (get-text-property (point) 'completion--string) + (choose-completion nil no-exit no-quit) + t)))) + (defun minibuffer-visible-completions--filter (cmd) "Return CMD if `minibuffer-visible-completions' bindings should be active." (if minibuffer-visible-completions--always-bind cmd - (when-let ((window (get-buffer-window "*Completions*" 0))) - (when (and (eq (buffer-local-value 'completion-reference-buffer - (window-buffer window)) - (window-buffer (active-minibuffer-window))) - (if (eq cmd #'minibuffer-choose-completion-or-exit) - (with-current-buffer (window-buffer window) - (get-text-property (point) 'completion--string)) - t)) + (when-let ((window (minibuffer--completions-visible))) + (when (if (eq cmd #'minibuffer-choose-completion-or-exit) + (with-current-buffer (window-buffer window) + (get-text-property (point) 'completion--string)) + t) cmd)))) (defun minibuffer-visible-completions--bind (binding) @@ -5109,10 +5132,8 @@ minibuffer-choose-completion-or-exit in the completions window, then exit the minibuffer using its present contents." (interactive "P") - (condition-case nil - (let ((choose-completion-deselect-if-after t)) - (minibuffer-choose-completion no-exit no-quit)) - (error (minibuffer-complete-and-exit)))) + (or (minibuffer-choose-completion-if-selected no-exit no-quit) + (minibuffer-complete-and-exit))) (defun minibuffer-complete-history () "Complete as far as possible using the minibuffer history. From unknown Sun Aug 17 22:05:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Apr 2025 18:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77253 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Spencer Baugh Cc: 77253@debbugs.gnu.org Received: via spool by 77253-submit@debbugs.gnu.org id=B77253.174370494010616 (code B ref 77253); Thu, 03 Apr 2025 18:29:02 +0000 Received: (at 77253) by debbugs.gnu.org; 3 Apr 2025 18:29:00 +0000 Received: from localhost ([127.0.0.1]:35642 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u0PJD-0002lA-PB for submit@debbugs.gnu.org; Thu, 03 Apr 2025 14:29:00 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:41511) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u0PJA-0002kv-Vg for 77253@debbugs.gnu.org; Thu, 03 Apr 2025 14:28:57 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id D14E8433EB; Thu, 3 Apr 2025 18:28:44 +0000 (UTC) From: Juri Linkov In-Reply-To: Organization: LINKOV.NET References: <87jz8d6n9x.fsf@mail.linkov.net> <87ldssz0t6.fsf@mail.linkov.net> <87r02iuzni.fsf@mail.linkov.net> <87ecyhskhg.fsf@mail.linkov.net> Date: Thu, 03 Apr 2025 21:19:16 +0300 Message-ID: <87a58x3y6z.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-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddukeelvdekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepvddprhgtphhtthhopeejjedvheefseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepshgsrghughhhsehjrghnvghsthhrvggvthdrtghomh 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 (-) >>> - It's not necessarily obvious that closing the completions window will >>> make the arrow keys operate in the minibuffer. Actually, maybe we >>> should update the completion help text to say that? That might help a >>> lot. >> >> Maybe it's possible to squeeze this help text just into one additional line? >> Something like: >> >> Type 'C-g' to close this window and restore arrows to move point. > > Maybe we don't even need an additional line? How about: > > Click or type RET on a completion to select it, or C-g to close this window. > Type , , , to move point between completions. Looks good. >>> - The new completion-eager-display makes *Completions* pop up >>> immediately; when this happens, it can be surprising that the arrow >>> keys don't work in the minibuffer from the very start of the >>> minibuffer session. >> >> Then another possible value for 'minibuffer-visible-completions' >> would be to not rebind left/right arrows when the completions window >> contains only one column (like on the browser's address bar). > > True. Though I guess that could maybe be the default behavior when > completions-format=one-column. Agreed. >>>> Not sure if it's possible for RET to accept the selected candidate >>>> by default since users might prefer to accept text in the minibuffer. >>> >>> If there's a selected candidate, though, then users have already decided >>> to use M-/M- to interact with completions. (Or they've >>> switched to the completions buffer and selected one) >>> >>> If they decide they don't want the candidate they selected, and want to >>> continue with text in the minibuffer, completion-auto-deselect will >>> automatically deselect the candidate if they type anything. >>> >>> I think these two facts combined make it possible for RET to accept the >>> selected candidate by default. >> >> Makes sense. So we need to try how well it performs. > > How about this? Thanks, will try to use for a while. > (BTW, after writing minibuffer--completions-visible, I'm wondering if > most of the code which calls (get-buffer-window "*Completions*" 0) is > actually buggy, because it's not checking completion-reference-buffer. > Should we replace ~all the calls to (get-buffer-window "*Completions*" > 0) with (minibuffer--completions-visible) which does check that?) Looks right, for example for the case of recursive minibuffers. > + (minibuffer-exit))) Typo: 'exit-minibuffer'. From unknown Sun Aug 17 22:05:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys Resent-From: sbaugh@catern.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Jul 2025 20:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77253 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: Spencer Baugh , 77253@debbugs.gnu.org Received: via spool by 77253-submit@debbugs.gnu.org id=B77253.175278447415529 (code B ref 77253); Thu, 17 Jul 2025 20:35:02 +0000 Received: (at 77253) by debbugs.gnu.org; 17 Jul 2025 20:34:34 +0000 Received: from localhost ([127.0.0.1]:57209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucVJJ-00042O-Vw for submit@debbugs.gnu.org; Thu, 17 Jul 2025 16:34:34 -0400 Received: from s.wrqvqsbb.outbound-mail.sendgrid.net ([149.72.70.187]:39808) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ucVJG-00041l-TK for 77253@debbugs.gnu.org; Thu, 17 Jul 2025 16:34:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:date:mime-version:to:cc: content-type:content-transfer-encoding:cc:content-type:date:from:subject:to; s=s1; bh=GCi/ko2iWP56bWXf/f+EdH12W2PPsTzbmCk7wl5qdzQ=; b=tvMeb3pLnS/ZVrAg3WafGW8mp0f2z+Zpw9LwFX6m+ewLrMzUnWwR/lRvuEpaEH2cNO3I ZXxEwVnSOscFwT8t4+C1aAijJWnDohey1wj/vzvKMGmQsN2JTeTuet6AUjKjyJ8eJPzXO8 Y7dqW6ykws2MHNhgtEdS3xrTgNyCIlXL2iZsvwswKWeHaYbNyJIgUsLg54WuuqD+DtHRqZ 2UnxOLDJcYRxuVsl2q2OZLz8iHr7cS2np3NydfrEcfdXCnUHfBYk1xnR7VD1XQTvO6Au0S G1JkFpzqHcPireR9C/mw5ufdDmpou2ncfm/j9FIhxOnpf06Xwy7gX9qGyhP1QqJQ== Received: by recvd-canary-c75fff999-2czjn with SMTP id recvd-canary-c75fff999-2czjn-1-68795E50-27 2025-07-17 20:34:24.716406851 +0000 UTC m=+2579304.480397118 Received: from earth.catern.com (unknown) by geopod-ismtpd-51 (SG) with ESMTP id pL2XetTWQ4qYkFVp8oaQHA Thu, 17 Jul 2025 20:34:24.660 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by earth.catern.com (Postfix) with ESMTPSA id 459B462512; Thu, 17 Jul 2025 16:34:24 -0400 (EDT) From: sbaugh@catern.com In-Reply-To: <87a58x3y6z.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 03 Apr 2025 21:19:16 +0300") References: <87jz8d6n9x.fsf@mail.linkov.net> <87ldssz0t6.fsf@mail.linkov.net> <87r02iuzni.fsf@mail.linkov.net> <87ecyhskhg.fsf@mail.linkov.net> <87a58x3y6z.fsf@mail.linkov.net> Date: Thu, 17 Jul 2025 20:34:24 +0000 (UTC) Message-ID: <87freuzhdb.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: u001.v6RTqHFpv1T6krEot6UFAVAJmQ+4h1t8/TfqqE2B07O5pjZyshpQqjJCfm/DHzc6vdjhU/SNdfnagwU9bU3JQyvUQq5aK94ULxAOU/5//aaNRY4gqNRfHcoSlMAM9dtcsTL/SgxUyfqwoDczzZuw3cs8pA3hxs4R6yzKiUd39nCG0orUMp1hCMHOqgbppDrCwAEnutvtbaOg/XwKWF6C1w== X-Entity-ID: u001.oW4JupFKOzCccZAQN2OOFQ== Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 (-) Juri Linkov writes: >>>>> Not sure if it's possible for RET to accept the selected candidate >>>>> by default since users might prefer to accept text in the minibuffer. >>>> >>>> If there's a selected candidate, though, then users have already decided >>>> to use M-/M- to interact with completions. (Or they've >>>> switched to the completions buffer and selected one) >>>> >>>> If they decide they don't want the candidate they selected, and want to >>>> continue with text in the minibuffer, completion-auto-deselect will >>>> automatically deselect the candidate if they type anything. >>>> >>>> I think these two facts combined make it possible for RET to accept the >>>> selected candidate by default. >>> >>> Makes sense. So we need to try how well it performs. >> >> How about this? > > Thanks, will try to use for a while. Any feedback on the patch? From unknown Sun Aug 17 22:05:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Jul 2025 06:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77253 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: sbaugh@catern.com Cc: Spencer Baugh , 77253@debbugs.gnu.org Received: via spool by 77253-submit@debbugs.gnu.org id=B77253.175282149729981 (code B ref 77253); Fri, 18 Jul 2025 06:52:01 +0000 Received: (at 77253) by debbugs.gnu.org; 18 Jul 2025 06:51:37 +0000 Received: from localhost ([127.0.0.1]:59948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucewP-0007nC-0l for submit@debbugs.gnu.org; Fri, 18 Jul 2025 02:51:37 -0400 Received: from mout-y-111.mailbox.org ([91.198.250.236]:41400) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucewK-0007mF-7o for 77253@debbugs.gnu.org; Fri, 18 Jul 2025 02:51:29 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-y-111.mailbox.org (Postfix) with ESMTPS id 4bk0nL2q7Zz9ygr; Fri, 18 Jul 2025 08:51:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; t=1752821478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lVYJ5k1HK+qSGlkVZvtvUB+xQ4nH+N/vI72Y5xex6mg=; b=h1x7LxQ9c7MSM7Q3T6SgjAvwtFNRYpNrU87zJnLIO4AcpbEdOd5cTJF1RwcNV+LB0Py1n2 rXNOHpOPW4IqkPGSHDIOyjqjSb+7eg9yMRT/k/m3wcQiBaQdrP4237qGbIZrlTJsciyObe v4CNCxXsEv5l/TwiiRjG2XqTzeFY2WYhLJG81BxtJmx2ErQXky90QQBKDNi1ryZz7K5ymG fwXlZsz2YUfkbywTXsp6JoNtVx4O7CGHQNB6STrqcZxtB50NewgWfePI+OqjJrwGcuoNth OENQwmQClI+TJjFncHH5PLiNlyYq0uuLRqVLnWpLEreGGe7Qx4qFS4OjcoDTeg== From: Juri Linkov In-Reply-To: <87freuzhdb.fsf@catern.com> Organization: LINKOV.NET References: <87jz8d6n9x.fsf@mail.linkov.net> <87ldssz0t6.fsf@mail.linkov.net> <87r02iuzni.fsf@mail.linkov.net> <87ecyhskhg.fsf@mail.linkov.net> <87a58x3y6z.fsf@mail.linkov.net> <87freuzhdb.fsf@catern.com> Date: Fri, 18 Jul 2025 09:38:33 +0300 Message-ID: <87h5zavwru.fsf@mail.linkov.net> 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 (-) >>>>>> Not sure if it's possible for RET to accept the selected candidate >>>>>> by default since users might prefer to accept text in the minibuffer. >>>>> >>>>> If there's a selected candidate, though, then users have already decided >>>>> to use M-/M- to interact with completions. (Or they've >>>>> switched to the completions buffer and selected one) >>>>> >>>>> If they decide they don't want the candidate they selected, and want to >>>>> continue with text in the minibuffer, completion-auto-deselect will >>>>> automatically deselect the candidate if they type anything. >>>>> >>>>> I think these two facts combined make it possible for RET to accept the >>>>> selected candidate by default. >>>> >>>> Makes sense. So we need to try how well it performs. >>> >>> How about this? >> >> Thanks, will try to use for a while. > > Any feedback on the patch? Everything looks good. Could you send the final version of the patch? From unknown Sun Aug 17 22:05:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Jul 2025 16:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77253 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: sbaugh@catern.com, 77253@debbugs.gnu.org Received: via spool by 77253-submit@debbugs.gnu.org id=B77253.175311506817515 (code B ref 77253); Mon, 21 Jul 2025 16:25:02 +0000 Received: (at 77253) by debbugs.gnu.org; 21 Jul 2025 16:24:28 +0000 Received: from localhost ([127.0.0.1]:58581 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1udtJT-0004YM-RF for submit@debbugs.gnu.org; Mon, 21 Jul 2025 12:24:28 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:42293) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1udtJR-0004Xt-Cj for 77253@debbugs.gnu.org; Mon, 21 Jul 2025 12:24:26 -0400 From: Spencer Baugh In-Reply-To: <87h5zavwru.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 18 Jul 2025 09:38:33 +0300") References: <87jz8d6n9x.fsf@mail.linkov.net> <87ldssz0t6.fsf@mail.linkov.net> <87r02iuzni.fsf@mail.linkov.net> <87ecyhskhg.fsf@mail.linkov.net> <87a58x3y6z.fsf@mail.linkov.net> <87freuzhdb.fsf@catern.com> <87h5zavwru.fsf@mail.linkov.net> Date: Mon, 21 Jul 2025 12:24:19 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1753115059; bh=Iancq068tNIEY0VQaBPPNpm0IOMz9ni8pdJTyXmkAho=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=ji3R7NRywgpRasYARkNqV6hI0sB7gFEt+zVP07JrmlxaTI8tf5Qs4QW4K5t8ybhmv +DRxsHE1WMBpEMwZSzNFk9Agob5t292hyHmaiOycE1NN/cLE0w9k5ZaNOrJ7pDl5Dt N+YW5OVXM5PuY2UHdSxlZIQl1+g6rcW+xwqw1cfy7JbYhLnVylXCc2HOkOAFMLe6P0 UWJ9A4q9sgLw24EVzUZOL8bSSNNepqYPB8QwJVgqDY7776iqrzvvDZBsmAjbIwZvHg kesC4vEqxxYdH9a8xltg3bmTPZatDfeRckuNUHQnK7BqyMwd498Vqkqb4HL2ntsi2M eOg/GJkynGLfA== 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 (---) --=-=-= Content-Type: text/plain Juri Linkov writes: >>>>>>> Not sure if it's possible for RET to accept the selected candidate >>>>>>> by default since users might prefer to accept text in the minibuffer. >>>>>> >>>>>> If there's a selected candidate, though, then users have already decided >>>>>> to use M-/M- to interact with completions. (Or they've >>>>>> switched to the completions buffer and selected one) >>>>>> >>>>>> If they decide they don't want the candidate they selected, and want to >>>>>> continue with text in the minibuffer, completion-auto-deselect will >>>>>> automatically deselect the candidate if they type anything. >>>>>> >>>>>> I think these two facts combined make it possible for RET to accept the >>>>>> selected candidate by default. >>>>> >>>>> Makes sense. So we need to try how well it performs. >>>> >>>> How about this? >>> >>> Thanks, will try to use for a while. >> >> Any feedback on the patch? > > Everything looks good. Could you send the final version of the patch? Yes, attached. (Note that this doesn't do the change I mentioned earlier of replacing (get-buffer-window "*Completions*" 0) everywhere with minibuffer--completions-visible, which probably should be done in a separate patch, I can send that if you're up to install it now) --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Make-RET-in-minibuffer-choose-selected-completion.patch >From df5c9ffe4669bd8417bb5ae3d631723e21e70d68 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Mon, 21 Jul 2025 12:22:19 -0400 Subject: [PATCH] Make RET in minibuffer choose selected completion Previously, one could select a completion via M-/M-, but then RET would not actually select the chosen completion. With the addition of completion-auto-deselect, this is not actually necessary: we can reasonably assume that when a completion is selected, the user wants to use that, since their last action must have been to select it. So, just choose the selected completion on RET. * lisp/minibuffer.el (minibuffer--completions-visible) (minibuffer-choose-completion-if-selected): Add. (minibuffer-choose-completion-or-exit): Use the more reliable minibuffer-choose-completion-if-selected instead of a condition-case. (minibuffer-local-must-match-map): Bind RET to minibuffer-choose-completion-or-exit instead of minibuffer-complete-and-exit. (bug#77253) (minibuffer-choose-completion-just-exit): Add. (minibuffer-local-completion-map): Bind RET to minibuffer-choose-completion-just-exit instead of exit-minibuffer. (minibuffer-visible-completions--filter): Use minibuffer--completions-visible. --- lisp/minibuffer.el | 47 +++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 64e3ad53b42..7a7f6aae44b 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3232,6 +3232,12 @@ completion-help-at-point (define-key map "\n" 'exit-minibuffer) (define-key map "\r" 'exit-minibuffer)) +(defun minibuffer-choose-completion-just-exit (&optional no-exit) + "Choose the selected completion from the minibuffer or call `exit-minibuffer'." + (interactive "P") + (or (minibuffer-choose-completion-if-selected no-exit) + (exit-minibuffer))) + (defvar-keymap minibuffer-local-completion-map :doc "Local keymap for minibuffer input with completion." :parent minibuffer-local-map @@ -3241,6 +3247,7 @@ minibuffer-local-completion-map ;; another binding for it. ;; "M-TAB" #'minibuffer-force-complete "SPC" #'minibuffer-complete-word + "RET" #'minibuffer-choose-completion-just-exit "?" #'minibuffer-completion-help "" #'switch-to-completions "M-v" #'switch-to-completions @@ -3252,7 +3259,7 @@ minibuffer-local-completion-map (defvar-keymap minibuffer-local-must-match-map :doc "Local keymap for minibuffer input with completion, for exact match." :parent minibuffer-local-completion-map - "RET" #'minibuffer-complete-and-exit + "RET" #'minibuffer-choose-completion-or-exit "C-j" #'minibuffer-complete-and-exit) (defvar-keymap minibuffer-local-filename-completion-map @@ -3349,18 +3356,34 @@ minibuffer-visible-completions (defvar minibuffer-visible-completions--always-bind nil "If non-nil, force the `minibuffer-visible-completions' bindings on.") +(defun minibuffer--completions-visible () + "Return the window where the *Completions* buffer for this minibuffer is visible." + (when-let ((window (get-buffer-window "*Completions*" 0))) + (when (eq (buffer-local-value 'completion-reference-buffer + (window-buffer window)) + (window-buffer (active-minibuffer-window))) + window))) + +(defun minibuffer-choose-completion-if-selected (&optional no-exit no-quit) + "Like `minibuffer-choose-completion', but do nothing if no candidate is selected. + +Return non-nil if a completion was chosen." + (when-let* ((window (minibuffer--completions-visible))) + (with-selected-window window + ;; Detect selection as if `choose-completion-deselect-if-after' is non-nil. + (when (get-text-property (point) 'completion--string) + (choose-completion nil no-exit no-quit) + t)))) + (defun minibuffer-visible-completions--filter (cmd) "Return CMD if `minibuffer-visible-completions' bindings should be active." (if minibuffer-visible-completions--always-bind cmd - (when-let ((window (get-buffer-window "*Completions*" 0))) - (when (and (eq (buffer-local-value 'completion-reference-buffer - (window-buffer window)) - (window-buffer (active-minibuffer-window))) - (if (eq cmd #'minibuffer-choose-completion-or-exit) - (with-current-buffer (window-buffer window) - (get-text-property (point) 'completion--string)) - t)) + (when-let ((window (minibuffer--completions-visible))) + (when (if (eq cmd #'minibuffer-choose-completion-or-exit) + (with-current-buffer (window-buffer window) + (get-text-property (point) 'completion--string)) + t) cmd)))) (defun minibuffer-visible-completions--bind (binding) @@ -5211,10 +5234,8 @@ minibuffer-choose-completion-or-exit in the completions window, then exit the minibuffer using its present contents." (interactive "P") - (condition-case nil - (let ((choose-completion-deselect-if-after t)) - (minibuffer-choose-completion no-exit no-quit)) - (error (minibuffer-complete-and-exit)))) + (or (minibuffer-choose-completion-if-selected no-exit no-quit) + (minibuffer-complete-and-exit))) (defun minibuffer-complete-history () "Complete as far as possible using the minibuffer history. -- 2.39.3 --=-=-=-- From unknown Sun Aug 17 22:05:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys, [PATCH] Make RET in minibuffer choose selected completion Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Jul 2025 16:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77253 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: sbaugh@catern.com, 77253@debbugs.gnu.org Received: via spool by 77253-submit@debbugs.gnu.org id=B77253.175311520118447 (code B ref 77253); Mon, 21 Jul 2025 16:27:01 +0000 Received: (at 77253) by debbugs.gnu.org; 21 Jul 2025 16:26:41 +0000 Received: from localhost ([127.0.0.1]:58609 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1udtLc-0004nT-Sm for submit@debbugs.gnu.org; Mon, 21 Jul 2025 12:26:41 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:36699) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1udtLa-0004n3-8W for 77253@debbugs.gnu.org; Mon, 21 Jul 2025 12:26:38 -0400 From: Spencer Baugh In-Reply-To: (Spencer Baugh's message of "Mon, 21 Jul 2025 12:24:19 -0400") References: <87jz8d6n9x.fsf@mail.linkov.net> <87ldssz0t6.fsf@mail.linkov.net> <87r02iuzni.fsf@mail.linkov.net> <87ecyhskhg.fsf@mail.linkov.net> <87a58x3y6z.fsf@mail.linkov.net> <87freuzhdb.fsf@catern.com> <87h5zavwru.fsf@mail.linkov.net> Date: Mon, 21 Jul 2025 12:26:32 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1753115192; bh=NXC/wMbbxNFZ97on/cHlEnx7ITONTVQrvAsmWFJBxbg=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=DRXnRAE2400kP5yZ+6lD9eig2nIKAFqelbVKybJzm+fsjmDdD++Ob8byBiYC8EXem OPSzDThhARnQ0pm1DMvcQswp4fRL6nJb8hKIyeuSGPIJx+ZUcFjtrQoTFTwIWll2GH IQod/GUgZDbOpZIU7puJpA3LIBKSitO4gc7mMYvW77NIeNdGEKuo8h/mHwD4HC42dd ErGXVfKhFB6NYqliMojzQFQkN9388P0WquitjcZWE+FOnjofuHKcgUUZMB4nPtdYxg xiDHcK+uLSJdNOEuR1bPPUyYkfrsgUl4t2qHKJFM0rvyqV2quHV7BmKJYf4s5uUpGW pgNIcyZk0uopQ== 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 (---) --=-=-= Content-Type: text/plain Spencer Baugh writes: > Juri Linkov writes: > >>>>>>>> Not sure if it's possible for RET to accept the selected candidate >>>>>>>> by default since users might prefer to accept text in the minibuffer. >>>>>>> >>>>>>> If there's a selected candidate, though, then users have already decided >>>>>>> to use M-/M- to interact with completions. (Or they've >>>>>>> switched to the completions buffer and selected one) >>>>>>> >>>>>>> If they decide they don't want the candidate they selected, and want to >>>>>>> continue with text in the minibuffer, completion-auto-deselect will >>>>>>> automatically deselect the candidate if they type anything. >>>>>>> >>>>>>> I think these two facts combined make it possible for RET to accept the >>>>>>> selected candidate by default. >>>>>> >>>>>> Makes sense. So we need to try how well it performs. >>>>> >>>>> How about this? >>>> >>>> Thanks, will try to use for a while. >>> >>> Any feedback on the patch? >> >> Everything looks good. Could you send the final version of the patch? > > Yes, attached. > > (Note that this doesn't do the change I mentioned earlier of replacing > (get-buffer-window "*Completions*" 0) everywhere with > minibuffer--completions-visible, which probably should be done in a > separate patch, I can send that if you're up to install it now) Oops sorry, that was the emacs-30 version, attached is the proper version for installing on trunk. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Make-RET-in-minibuffer-choose-selected-completion.patch >From 1b969351e067982e6735574bc505ca52e31a8f11 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Mon, 21 Jul 2025 12:22:19 -0400 Subject: [PATCH] Make RET in minibuffer choose selected completion Previously, one could select a completion via M-/M-, but then RET would not actually select the chosen completion. With the addition of completion-auto-deselect, this is not actually necessary: we can reasonably assume that when a completion is selected, the user wants to use that, since their last action must have been to select it. So, just choose the selected completion on RET. * lisp/minibuffer.el (minibuffer--completions-visible) (minibuffer-choose-completion-if-selected): Add. (minibuffer-choose-completion-or-exit): Use the more reliable minibuffer-choose-completion-if-selected instead of a condition-case. (minibuffer-local-must-match-map): Bind RET to minibuffer-choose-completion-or-exit instead of minibuffer-complete-and-exit. (bug#77253) (minibuffer-choose-completion-just-exit): Add. (minibuffer-local-completion-map): Bind RET to minibuffer-choose-completion-just-exit instead of exit-minibuffer. (minibuffer-visible-completions--filter): Use minibuffer--completions-visible. --- lisp/minibuffer.el | 47 +++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 6f9e6c67541..12f66f57747 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3226,6 +3226,12 @@ completion-help-at-point (define-key map "\n" 'exit-minibuffer) (define-key map "\r" 'exit-minibuffer)) +(defun minibuffer-choose-completion-just-exit (&optional no-exit) + "Choose the selected completion from the minibuffer or call `exit-minibuffer'." + (interactive "P") + (or (minibuffer-choose-completion-if-selected no-exit) + (exit-minibuffer))) + (defvar-keymap minibuffer-local-completion-map :doc "Local keymap for minibuffer input with completion." :parent minibuffer-local-map @@ -3235,6 +3241,7 @@ minibuffer-local-completion-map ;; another binding for it. ;; "M-TAB" #'minibuffer-force-complete "SPC" #'minibuffer-complete-word + "RET" #'minibuffer-choose-completion-just-exit "?" #'minibuffer-completion-help "" #'switch-to-completions "M-v" #'switch-to-completions @@ -3246,7 +3253,7 @@ minibuffer-local-completion-map (defvar-keymap minibuffer-local-must-match-map :doc "Local keymap for minibuffer input with completion, for exact match." :parent minibuffer-local-completion-map - "RET" #'minibuffer-complete-and-exit + "RET" #'minibuffer-choose-completion-or-exit "C-j" #'minibuffer-complete-and-exit) (defvar-keymap minibuffer-local-filename-completion-map @@ -3343,18 +3350,34 @@ minibuffer-visible-completions (defvar minibuffer-visible-completions--always-bind nil "If non-nil, force the `minibuffer-visible-completions' bindings on.") +(defun minibuffer--completions-visible () + "Return the window where the *Completions* buffer for this minibuffer is visible." + (when-let ((window (get-buffer-window "*Completions*" 0))) + (when (eq (buffer-local-value 'completion-reference-buffer + (window-buffer window)) + (window-buffer (active-minibuffer-window))) + window))) + +(defun minibuffer-choose-completion-if-selected (&optional no-exit no-quit) + "Like `minibuffer-choose-completion', but do nothing if no candidate is selected. + +Return non-nil if a completion was chosen." + (when-let* ((window (minibuffer--completions-visible))) + (with-selected-window window + ;; Detect selection as if `choose-completion-deselect-if-after' is non-nil. + (when (get-text-property (point) 'completion--string) + (choose-completion nil no-exit no-quit) + t)))) + (defun minibuffer-visible-completions--filter (cmd) "Return CMD if `minibuffer-visible-completions' bindings should be active." (if minibuffer-visible-completions--always-bind cmd - (when-let* ((window (get-buffer-window "*Completions*" 0))) - (when (and (eq (buffer-local-value 'completion-reference-buffer - (window-buffer window)) - (window-buffer (active-minibuffer-window))) - (if (eq cmd #'minibuffer-choose-completion-or-exit) - (with-current-buffer (window-buffer window) - (get-text-property (point) 'completion--string)) - t)) + (when-let* ((window (minibuffer--completions-visible))) + (when (if (eq cmd #'minibuffer-choose-completion-or-exit) + (with-current-buffer (window-buffer window) + (get-text-property (point) 'completion--string)) + t) cmd)))) (defun minibuffer-visible-completions--bind (binding) @@ -5286,10 +5309,8 @@ minibuffer-choose-completion-or-exit in the completions window, then exit the minibuffer using its present contents." (interactive "P") - (condition-case nil - (let ((choose-completion-deselect-if-after t)) - (minibuffer-choose-completion no-exit no-quit)) - (error (minibuffer-complete-and-exit)))) + (or (minibuffer-choose-completion-if-selected no-exit no-quit) + (minibuffer-complete-and-exit))) (defun minibuffer-complete-history () "Complete as far as possible using the minibuffer history. -- 2.39.3 --=-=-=-- From unknown Sun Aug 17 22:05:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys, [PATCH] Make RET in minibuffer choose selected completion Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Jul 2025 12:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77253 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Spencer Baugh Cc: sbaugh@catern.com, 77253@debbugs.gnu.org, juri@linkov.net Received: via spool by 77253-submit@debbugs.gnu.org id=B77253.175318627711024 (code B ref 77253); Tue, 22 Jul 2025 12:12:02 +0000 Received: (at 77253) by debbugs.gnu.org; 22 Jul 2025 12:11:17 +0000 Received: from localhost ([127.0.0.1]:35975 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ueBq0-0002rj-Fs for submit@debbugs.gnu.org; Tue, 22 Jul 2025 08:11:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52874) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ueBpw-0002rE-Ea for 77253@debbugs.gnu.org; Tue, 22 Jul 2025 08:11:13 -0400 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 1ueBpp-0002uI-Ls; Tue, 22 Jul 2025 08:11:05 -0400 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=qCYoZfG8pUa17LEr1e8hlHoiN2zUh1YgemetzcMM9cI=; b=GY8EzVpPR1QD CHSQe/gIqz3Ph0hU+ncA9t+DiStcUoqI7L2QgtQyIMrRqesnPp1h63UOSrCYwkm4g0s3LGbGXn6X8 FCpCnoXtUbicbTJJQ/XGbmK+wROwVM8zE6FQ6n6MKFQkdR3smUdBeLY2XQjl4yPx/Jz3z4QOorXOx svKRXWTrrPVpIbYLLsdLuKkrJOmfmXsKeQIEu1J9gIFRYaaMOwRlm2wTVKFn1Osrf/TG6yMbZikwu bwXhYz6dR/9pFV90KYVfFGWRirtcY6CirIVoJj87uEgzt+yWHVe7zaljMqNqSf7U6GNlywYkHYjfQ dZA2NeKBmOCqmWH96iV6cQ==; Date: Tue, 22 Jul 2025 15:11:01 +0300 Message-Id: <86seioa0iy.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (bug-gnu-emacs@gnu.org) References: <87jz8d6n9x.fsf@mail.linkov.net> <87ldssz0t6.fsf@mail.linkov.net> <87r02iuzni.fsf@mail.linkov.net> <87ecyhskhg.fsf@mail.linkov.net> <87a58x3y6z.fsf@mail.linkov.net> <87freuzhdb.fsf@catern.com> <87h5zavwru.fsf@mail.linkov.net> 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: sbaugh@catern.com, 77253@debbugs.gnu.org > Date: Mon, 21 Jul 2025 12:26:32 -0400 > From: Spencer Baugh via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > @@ -3235,6 +3241,7 @@ minibuffer-local-completion-map > ;; another binding for it. > ;; "M-TAB" #'minibuffer-force-complete > "SPC" #'minibuffer-complete-word > + "RET" #'minibuffer-choose-completion-just-exit > "?" #'minibuffer-completion-help > "" #'switch-to-completions > "M-v" #'switch-to-completions > @@ -3246,7 +3253,7 @@ minibuffer-local-completion-map > (defvar-keymap minibuffer-local-must-match-map > :doc "Local keymap for minibuffer input with completion, for exact match." > :parent minibuffer-local-completion-map > - "RET" #'minibuffer-complete-and-exit > + "RET" #'minibuffer-choose-completion-or-exit > "C-j" #'minibuffer-complete-and-exit) Can we please not to change commands bound to keys? That will make the changes much more backward-compatible. In any case, this warrants a NEWS entry. Thanks. From unknown Sun Aug 17 22:05:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys, [PATCH] Make RET in minibuffer choose selected completion Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Jul 2025 17:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77253 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Spencer Baugh , 77253@debbugs.gnu.org, sbaugh@catern.com Received: via spool by 77253-submit@debbugs.gnu.org id=B77253.175337740816926 (code B ref 77253); Thu, 24 Jul 2025 17:17:02 +0000 Received: (at 77253) by debbugs.gnu.org; 24 Jul 2025 17:16:48 +0000 Received: from localhost ([127.0.0.1]:58111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uezYl-0004Ot-W7 for submit@debbugs.gnu.org; Thu, 24 Jul 2025 13:16:48 -0400 Received: from mout-y-111.mailbox.org ([91.198.250.236]:42710) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uezYi-0004OK-NB for 77253@debbugs.gnu.org; Thu, 24 Jul 2025 13:16:46 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-y-111.mailbox.org (Postfix) with ESMTPS id 4bnyN36d1Jz9y0b; Thu, 24 Jul 2025 19:16:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; t=1753377395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AMY8VDtvj82Yf32CiINO+g1OJiKSU+16wu/FZhXa6ZI=; b=sOsQS9TCDchjgfL/PFiWaZUdSs0BGBOvW7dt5fpq1TCCiHNKmpqjAEsaRccfWBZ4eDide6 KV2DXINvkWtFoCHXcR918e+wB6doZAa0UiuVQiT87SFjke7L86/TuNlm31h2PA4vpAhuOx 2hAmXTnSaJHKw8tUvL1pqlEmWIozZVtgkMWOl8EccB2vdGU4FUV5MCazc0G5Cj8Ru5jlgh uLeoyXTLB8lVXYGE0cx1IVShqLHyklFVZtVMDtmp/1B0m83FDzH5GVe+7VaLPrBCDZw/gs Pt8shQGVVHrYEC+/A4dRsK0QumTmLjSVxsg1oIwWU53B4/UoosZOO8QfPZPffA== From: Juri Linkov In-Reply-To: <86seioa0iy.fsf@gnu.org> Organization: LINKOV.NET References: <87jz8d6n9x.fsf@mail.linkov.net> <87ldssz0t6.fsf@mail.linkov.net> <87r02iuzni.fsf@mail.linkov.net> <87ecyhskhg.fsf@mail.linkov.net> <87a58x3y6z.fsf@mail.linkov.net> <87freuzhdb.fsf@catern.com> <87h5zavwru.fsf@mail.linkov.net> <86seioa0iy.fsf@gnu.org> Date: Thu, 24 Jul 2025 20:10:41 +0300 Message-ID: <87bjp9v7ji.fsf@mail.linkov.net> 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 (-) >> @@ -3235,6 +3241,7 @@ minibuffer-local-completion-map >> ;; another binding for it. >> ;; "M-TAB" #'minibuffer-force-complete >> "SPC" #'minibuffer-complete-word >> + "RET" #'minibuffer-choose-completion-just-exit >> "?" #'minibuffer-completion-help >> "" #'switch-to-completions >> "M-v" #'switch-to-completions >> @@ -3246,7 +3253,7 @@ minibuffer-local-completion-map >> (defvar-keymap minibuffer-local-must-match-map >> :doc "Local keymap for minibuffer input with completion, for exact match." >> :parent minibuffer-local-completion-map >> - "RET" #'minibuffer-complete-and-exit >> + "RET" #'minibuffer-choose-completion-or-exit >> "C-j" #'minibuffer-complete-and-exit) > > Can we please not to change commands bound to keys? That will make > the changes much more backward-compatible. First we discussed adding a new option like 'minibuffer-visible-completions' that affects only RET, not arrow keys. But now we arrived at a patch that rebinds the default keybindings. So I'm not sure how this would affect the current default behavior. IIUC, previously after selecting a candidate with M-down the user needed to type M-RET, and after applying the patch just RET will be sufficient? But it was already possible to use RET with 'minibuffer-completion-auto-choose' equal to t when M-down inserts the completion candidate to the minibuffer.