From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 25 11:11:12 2025 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 To: bug-gnu-emacs@gnu.org Subject: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys X-Debbugs-Cc: 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-Debbugs-Envelope-To: submit Cc: 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: -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 debbugs-submit-bounces@debbugs.gnu.org Tue Mar 25 13:22:47 2025 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 To: Spencer Baugh Subject: Re: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys 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-Debbugs-Envelope-To: submit Cc: bug-gnu-emacs@gnu.org 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 debbugs-submit-bounces@debbugs.gnu.org Tue Mar 25 13:25:18 2025 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 To: Juri Linkov Subject: Re: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys 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-Debbugs-Envelope-To: 77253 Cc: 77253@debbugs.gnu.org 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 debbugs-submit-bounces@debbugs.gnu.org Wed Mar 26 03:53:32 2025 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 To: Spencer Baugh Subject: Re: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys 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-Debbugs-Envelope-To: 77253 Cc: 77253@debbugs.gnu.org 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 debbugs-submit-bounces@debbugs.gnu.org Wed Mar 26 10:06:34 2025 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 To: Juri Linkov Subject: Re: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys 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-Debbugs-Envelope-To: 77253 Cc: 77253@debbugs.gnu.org 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 debbugs-submit-bounces@debbugs.gnu.org Thu Mar 27 14:00:35 2025 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 To: Spencer Baugh Subject: Re: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys 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-Debbugs-Envelope-To: 77253 Cc: 77253@debbugs.gnu.org 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 debbugs-submit-bounces@debbugs.gnu.org Thu Mar 27 16:42:38 2025 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 To: Juri Linkov Subject: Re: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys 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-Debbugs-Envelope-To: 77253 Cc: 77253@debbugs.gnu.org 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 debbugs-submit-bounces@debbugs.gnu.org Fri Mar 28 03:32:29 2025 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 To: Spencer Baugh Subject: Re: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys 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-Debbugs-Envelope-To: 77253 Cc: 77253@debbugs.gnu.org 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 debbugs-submit-bounces@debbugs.gnu.org Thu Apr 03 13:52:53 2025 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 To: Juri Linkov Subject: Re: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys 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-Debbugs-Envelope-To: 77253 Cc: 77253@debbugs.gnu.org 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 debbugs-submit-bounces@debbugs.gnu.org Thu Apr 03 14:29:00 2025 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 To: Spencer Baugh Subject: Re: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys 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-Debbugs-Envelope-To: 77253 Cc: 77253@debbugs.gnu.org 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'.