From unknown Fri Sep 12 01:59:01 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#67001 <67001@debbugs.gnu.org> To: bug#67001 <67001@debbugs.gnu.org> Subject: Status: [PATCH] ; Promptly disable 'completion-in-region-mode' Reply-To: bug#67001 <67001@debbugs.gnu.org> Date: Fri, 12 Sep 2025 08:59:01 +0000 retitle 67001 [PATCH] ; Promptly disable 'completion-in-region-mode' reassign 67001 emacs submitter 67001 Eshel Yaron severity 67001 normal tag 67001 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 08 12:54:03 2023 Received: (at submit) by debbugs.gnu.org; 8 Nov 2023 17:54:03 +0000 Received: from localhost ([127.0.0.1]:46270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0mkc-000851-Nt for submit@debbugs.gnu.org; Wed, 08 Nov 2023 12:54:03 -0500 Received: from lists.gnu.org ([2001:470:142::17]:45882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0mkX-00084Q-Hm for submit@debbugs.gnu.org; Wed, 08 Nov 2023 12:54:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0mjp-0007nO-HI for bug-gnu-emacs@gnu.org; Wed, 08 Nov 2023 12:53:13 -0500 Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0mjn-0003Ws-UI for bug-gnu-emacs@gnu.org; Wed, 08 Nov 2023 12:53:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1699465991; bh=d59ZueYsz53KRbg9nH4/IK53GJQfGYgpqJyOOEnobWU=; h=From:To:Subject:Date:From; b=f5sHDkclKaKh9sG7QUeVMpJio7Umpz3UULT/Ik1ZlgzwyhR/ldjX7JhW9sWIkpWbV DZfyF9MV2ICrTal8DFBM+6jOYdBgZ6G2hNQshEcCbmb2wMjoqCmN6dFQYT/vxkyqRC RWFtAKvLlQRhUeg/b6+n6+xJf9pBGgLgfwB/xo5CQkZLyjKjnIKvHgZ79TmiQw8UqQ 5dxY6HCwkivQ9d6h5RwIgCFg7V6lFaqr8RzA4zoB5048Jfg0JBySSBtGcz2mZN2ZKg 7r05LlaF277XuhtYh4Y3Ud3d0dGzMF7NiNeWv3fqyN1NUl381fmkdmo+cCjlNpNsgT SkNZPMRKIdEUw== From: Eshel Yaron To: bug-gnu-emacs@gnu.org Subject: [PATCH] ; Promptly disable 'completion-in-region-mode' X-Debbugs-CC: Juri Linkov Date: Wed, 08 Nov 2023 18:53:08 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@eshelyaron.com; helo=eshelyaron.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) --=-=-= Content-Type: text/plain Tags: patch This patch addresses an issue that Juri (CC'd) observed in Bug#66948, where `completion-at-point` leaves TAB bound to `completion-at-point` even when it doesn't show the completions list. To reproduce: 1. emacs -Q 2. In the *scratch* buffer, insert the following: --8<---------------cut here---------------start------------->8--- (defun foo () bar --8<---------------cut here---------------end--------------->8--- 3. With point after "bar", press C-M-i to invoke `completion-at-point`. This shows a message saying "No match". That's expected. 4. Press TAB. This again shows a message saying "No match". This is unexpected, instead TAB should indent "bar" as usual. --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Promptly-disable-completion-in-region-mode.patch >From 846659798143826351de01d10b69613ec1d16c9a Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Wed, 8 Nov 2023 18:27:03 +0100 Subject: [PATCH] ; Promptly disable 'completion-in-region-mode' Avoid keeping 'completion-in-region-mode' on when exiting 'completion--in-region-1' if the *Completions* buffer isn't shown. Otherwise, the bindings from 'completion-in-region-mode-map' linger, notable shadowing other bindings for TAB. * lisp/minibuffer.el (completion--in-region-1): Disable 'completion-in-region-mode' if the *Completions* buffer isn't visible. --- lisp/minibuffer.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index bf1e014319e..d84e92fc013 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1561,11 +1561,12 @@ completion--in-region-1 (t (prog1 (pcase (completion--do-completion beg end) (#b000 nil) (_ t)) - (when (and (eq completion-auto-select t) - (window-live-p minibuffer-scroll-window) - (eq t (frame-visible-p (window-frame minibuffer-scroll-window)))) - ;; When the completion list window was displayed, select it. - (switch-to-completions)))))) + (if (window-live-p minibuffer-scroll-window) + (and (eq completion-auto-select t) + (eq t (frame-visible-p (window-frame minibuffer-scroll-window))) + ;; When the completion list window was displayed, select it. + (switch-to-completions)) + (completion-in-region-mode -1)))))) (defun completion--cache-all-sorted-completions (beg end comps) (add-hook 'after-change-functions -- 2.42.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 09 02:43:38 2023 Received: (at 67001) by debbugs.gnu.org; 9 Nov 2023 07:43:39 +0000 Received: from localhost ([127.0.0.1]:46727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0zhS-0005B9-C0 for submit@debbugs.gnu.org; Thu, 09 Nov 2023 02:43:38 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:57997) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0zhO-0005Am-9i; Thu, 09 Nov 2023 02:43:36 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 4A9C460002; Thu, 9 Nov 2023 07:42:46 +0000 (UTC) From: Juri Linkov To: Eshel Yaron Subject: Re: bug#67001: [PATCH] ; Promptly disable 'completion-in-region-mode' In-Reply-To: (Eshel Yaron's message of "Wed, 08 Nov 2023 18:53:08 +0100") Organization: LINKOV.NET References: Date: Thu, 09 Nov 2023 09:41:57 +0200 Message-ID: <86fs1fcr0a.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 67001 Cc: 67001@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 (-) close 67001 30.0.50 thanks > This patch addresses an issue that Juri (CC'd) observed in Bug#66948, > where `completion-at-point` leaves TAB bound to `completion-at-point` > even when it doesn't show the completions list. > > To reproduce: > 1. emacs -Q > 2. In the *scratch* buffer, insert the following: > > (defun foo () > bar > > 3. With point after "bar", press C-M-i to invoke `completion-at-point`. > This shows a message saying "No match". That's expected. > 4. Press TAB. This again shows a message saying "No match". > This is unexpected, instead TAB should indent "bar" as usual. Thanks for the patch. This looks like the right way to fix this issue. So now pushed to master. From unknown Fri Sep 12 01:59:01 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 07 Dec 2023 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator