From unknown Sun Jun 22 00:11:32 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17899: 24.3.92.1; dabbrev-completion incorrectly searches all buffers Resent-From: Stefan Guath Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Jul 2014 13:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17899 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 17899@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.140430932710036 (code B ref -1); Wed, 02 Jul 2014 13:56:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 Jul 2014 13:55:27 +0000 Received: from localhost ([127.0.0.1]:40125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X2L0P-0002bn-LW for submit@debbugs.gnu.org; Wed, 02 Jul 2014 09:55:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55168) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X2L0J-0002aQ-NI for submit@debbugs.gnu.org; Wed, 02 Jul 2014 09:55:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2L05-0003mR-EJ for submit@debbugs.gnu.org; Wed, 02 Jul 2014 09:55:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2L05-0003mG-Be for submit@debbugs.gnu.org; Wed, 02 Jul 2014 09:55:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2Kzw-0004wJ-Ak for bug-gnu-emacs@gnu.org; Wed, 02 Jul 2014 09:55:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2Kzn-0003b6-9b for bug-gnu-emacs@gnu.org; Wed, 02 Jul 2014 09:54:56 -0400 Received: from mail-la0-x22c.google.com ([2a00:1450:4010:c03::22c]:59819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2Kzn-0003au-0j for bug-gnu-emacs@gnu.org; Wed, 02 Jul 2014 09:54:47 -0400 Received: by mail-la0-f44.google.com with SMTP id ty20so7100070lab.31 for ; Wed, 02 Jul 2014 06:54:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:content-type:content-transfer-encoding:subject :message-id:date:to:mime-version; bh=fJpklCXLNdNyRGzJQ4soQRFxexB2CkhhEOdeLiS6OvU=; b=QgKTHAATr6AsWZ+UmSfdTH7b4+EHxajixSPGPl8vwOiVaXMn+sJPCmQ4duOkDGB6xV BuR7MTo27p1PYCh8pfC3tRATTfm8nvqr/UEuF+hPigazms2fcRAoTdFduKOzrSamPsIQ K/EH2AzTBAucZa2pfZW9LsUrbJ34yFcNysR5wNhFEA2qVEGBMYKX4RL5D1s1HL0Pq3Sw kIrTJZZAP/ueXafN6UPx8w2ivYsDe4rKk6FjXBEkg2lJun0MbK5xnGKUTQqVPvoYIkJI 7msFlSFS71sL8oC2EN/DWfKWXibrDCt+AS2BGBR4iLpTIlbX6KrcgBe+X4RiBKXFjmC8 YdCg== X-Received: by 10.152.37.99 with SMTP id x3mr2448020laj.55.1404309284806; Wed, 02 Jul 2014 06:54:44 -0700 (PDT) Received: from [192.168.0.11] (c213-89-126-209.bredband.comhem.se. [213.89.126.209]) by mx.google.com with ESMTPSA id j13sm11878070lab.39.2014.07.02.06.54.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Jul 2014 06:54:44 -0700 (PDT) From: Stefan Guath Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: Date: Wed, 2 Jul 2014 15:54:43 +0200 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) X-Mailer: Apple Mail (2.1878.2) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -4.0 (----) VERSION: GNU Emacs 24.3.92.1 (x86_64-apple-darwin13.2.0, NS apple-appkit-1265.20) TO REPRODUCE BUG: * emacs -Q * Create two buffers (C-x b) with the following contents: foo.el: "idris0 idris1" bar.el: "ideal0 ideal1" * Go to end of foo.el, write "id" and execute dabbrev-completion (C-M-/) EXPECTED RESULT "id" should complete to "idris". The doc of dabbrev-completion is very = clear on this: "Like M-/ but finds all expansions in the current buffer and presents suggestions for completion. With a prefix argument ARG, it searches all buffers accepted by the function pointed out by `dabbrev-friend-buffer-function' to find the completions. If the prefix argument is 16 (which comes from C-u C-u), then it searches *all* buffers." No prefix was given here, so it should just look in the current buffer. ACTUAL RESULT A new buffer opens with the text: "In this buffer, type RET to select the completion near point. Possible completions are: ideal0 ideal1 idris0 idris1" Apparently, the buffer bar.el was incorrectly taken into account. After = killing buffer bar.el, dabbrev-completion completes as expected in = foo.el.= From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 02 13:52:07 2014 Received: (at control) by debbugs.gnu.org; 2 Jul 2014 17:52:07 +0000 Received: from localhost ([127.0.0.1]:40680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X2OhO-0003qx-EB for submit@debbugs.gnu.org; Wed, 02 Jul 2014 13:52:07 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:47401 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X2OhI-0003qN-0c for control@debbugs.gnu.org; Wed, 02 Jul 2014 13:52:01 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1X2OhH-0005KE-Fn for control@debbugs.gnu.org; Wed, 02 Jul 2014 13:51:55 -0400 Date: Wed, 02 Jul 2014 13:51:55 -0400 Message-Id: Subject: control message for bug 17899 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.0 (-----) found 17899 23.1 From unknown Sun Jun 22 00:11:32 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17899: Source of bug? References: In-Reply-To: Resent-From: Stefan Guath Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Jul 2014 11:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17899 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 17899@debbugs.gnu.org Received: via spool by 17899-submit@debbugs.gnu.org id=B17899.140438783017345 (code B ref 17899); Thu, 03 Jul 2014 11:44:01 +0000 Received: (at 17899) by debbugs.gnu.org; 3 Jul 2014 11:43:50 +0000 Received: from localhost ([127.0.0.1]:41138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X2fQb-0004Vf-Gb for submit@debbugs.gnu.org; Thu, 03 Jul 2014 07:43:50 -0400 Received: from mail-wg0-f43.google.com ([74.125.82.43]:51603) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X2fQU-0004V9-I5 for 17899@debbugs.gnu.org; Thu, 03 Jul 2014 07:43:47 -0400 Received: by mail-wg0-f43.google.com with SMTP id b13so91742wgh.26 for <17899@debbugs.gnu.org>; Thu, 03 Jul 2014 04:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:content-type:content-transfer-encoding:subject :message-id:date:to:mime-version; bh=csNgUyIZh3zrQxZYPpXL16a35xUp2XVSPMoWvF41QqE=; b=JhK+aQLqTQjfmkj/zNJFOiR7nMrnKqV/aPbayZjbxBrMC69PHKNRrmC36doXdCXEJg Hzj9RLw4KaJyzFLEUzBqt/TjSUTWc4TT1dupw51XDgSDDfl//NafYyzSTvSO2p9gKmd+ TdP9bcnR+tuL/LLmiMKSsurG084D97G3V1PYL/N7Dy/No0T5tfL7SO6wwOrhA7yF06Z7 fAhOIi8uv5OFyJ9elam7pFFjHYiR1cj/CvXjIRbJUF8r3baXlnwfsv/g/mm/owDhiT0Z inIc/mhydO6Y9ly6gAxdySpHaLey76QOVpPnCDwNRZWbUq1AIjcarUvY+ZjkN518tpVh I56w== X-Received: by 10.194.82.106 with SMTP id h10mr2443812wjy.115.1404387816638; Thu, 03 Jul 2014 04:43:36 -0700 (PDT) Received: from [10.157.59.192] ([64.208.157.250]) by mx.google.com with ESMTPSA id cx5sm61541676wjb.8.2014.07.03.04.43.35 for <17899@debbugs.gnu.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Jul 2014 04:43:35 -0700 (PDT) From: Stefan Guath Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: Date: Thu, 3 Jul 2014 13:43:34 +0200 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) X-Mailer: Apple Mail (2.1878.2) X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.7 (/) `dabbrev-completion' dynamically binds `dabbrev-check-other-buffers' to = the correct value, but later down the call chain (i.e. = `dabbrev--find-all-expansions' -> `dabbrev--find-expansion' -> = `dabbrev--make-friend-buffer-list'), `dabbrev--make-friend-buffer-list' = instead uses the internal `dabbrev--check-other-buffers' which is not = updated accordingly. Could this be the source of the error? /Stefan Guath= From unknown Sun Jun 22 00:11:32 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17899: 24.3.92.1; dabbrev-completion incorrectly searches all buffers Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Dec 2019 13:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17899 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Guath Cc: 17899@debbugs.gnu.org Received: via spool by 17899-submit@debbugs.gnu.org id=B17899.157555196624084 (code B ref 17899); Thu, 05 Dec 2019 13:20:01 +0000 Received: (at 17899) by debbugs.gnu.org; 5 Dec 2019 13:19:26 +0000 Received: from localhost ([127.0.0.1]:43301 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icr2U-0006GO-8b for submit@debbugs.gnu.org; Thu, 05 Dec 2019 08:19:26 -0500 Received: from mail-wr1-f51.google.com ([209.85.221.51]:36795) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icr2R-0006GB-QJ for 17899@debbugs.gnu.org; Thu, 05 Dec 2019 08:19:25 -0500 Received: by mail-wr1-f51.google.com with SMTP id z3so3576418wru.3 for <17899@debbugs.gnu.org>; Thu, 05 Dec 2019 05:19:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=noHB3tHsVHQCfGnchHqsrfiu2bzaP6guuIDXmZyfvjM=; b=jvPsxOqY2WzonoNYrfddbeKF3ifpe08K84/t9L6NCeMncSyp35f6+3r8apwgBYseMw Hwz0T4C6M+M81LhRZuGaifeEKRyRWkubJlTU6fCkltnr7yAULTLjBH8TNlRf6ogbtuzj IzBYyCNgCyf0FohXjYQJrjyk0cnTwDk/wlrS0rpcQNgEeGmxb5heQPREPZjtSd21ux3x rFW84IABCnZSJmxL6B6FK/YFJxlp8hsckQ1/dKakG9iTqsbuN0Ds7s9yUCAbvjK0gQgE XUCmYuSDEJiNdCsHSBmw/vMKkFDm6KaMXEVyiOEDTXmJh11BHz8Oza+q7eUkULv1Z3mU YRIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=noHB3tHsVHQCfGnchHqsrfiu2bzaP6guuIDXmZyfvjM=; b=PVMxfGf8100ouG87zHMt0ah2jaoPdFjFY5AtFeIiBFWCXFlvg8y27VOOUMQBxF892U uX0tmQpesuWBraIJs1eHP+HV8l7gxZNNxU4M8UJzsv+45vLHeUWcaDEsC6t5jNjJ4h5Y ToIK8E6QcW767M6OAuEY7hhrml4s4Dw+lIdYxb45/W5XmLSilYo41isSnzU3D0T05A1k bRsY1cw++p7zpTTyOGyvF6xaWnbyFjwUkVUp131qm2rsZ5JwZ7aXjF4/kgSySsjIlBRp kIH+kxdT0JO4krtG0O+OpVRS8FJzFQrP634bee4gK2gsfwzKlPryI6AxR0hLPdg7u6H2 6Mbg== X-Gm-Message-State: APjAAAWN1S1Vdi8ohanvx3Gl7FfD2sHf/GfOyGLtjbhHXZDfU4sk21QL ccqjTgVUC44pCeAc27hVhtuTsgESkvo= X-Google-Smtp-Source: APXvYqzm/d9zyL7BqOLX7YRpIyJFdhshFx3ePg3vzEPiJxZs7l3iNx8CAIuzHaRMzqU/w+dU2z5PLw== X-Received: by 2002:a5d:4692:: with SMTP id u18mr10443627wrq.206.1575551956614; Thu, 05 Dec 2019 05:19:16 -0800 (PST) Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-8586-a56f-eccc-754e.holly.idiocy.org. [2001:8b0:3f8:8129:8586:a56f:eccc:754e]) by smtp.gmail.com with ESMTPSA id y10sm1779443wmm.3.2019.12.05.05.19.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2019 05:19:14 -0800 (PST) From: Alan Third References: Date: Thu, 05 Dec 2019 13:19:13 +0000 In-Reply-To: (Stefan Guath's message of "Wed, 2 Jul 2014 15:54:43 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (darwin) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.5 (/) 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.5 (/) --=-=-= Content-Type: text/plain Stefan Guath writes: > TO REPRODUCE BUG: > * emacs -Q > * Create two buffers (C-x b) with the following contents: > foo.el: "idris0 idris1" > bar.el: "ideal0 ideal1" > * Go to end of foo.el, write "id" and execute dabbrev-completion (C-M-/) > > EXPECTED RESULT > "id" should complete to "idris". Hi, sorry it took so long for someone to look at this. I believe the attached patch fixes it. The problem seems to have been switching dabbrev.el over to using lexical scoping. It was previously using let* to temporarily override a couple of global variables, which works with dynamic scoping, but not lexical. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Fix-dabbrev-completion-bug-17899.patch >From 40946b12d9583e87b89a3c942ed418990cc35355 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Thu, 5 Dec 2019 13:14:00 +0000 Subject: [PATCH] Fix dabbrev-completion (bug#17899) * lisp/dabbrev.el (dabbrev--check-all-buffers): Add new variable. (dabbrev-completion): Lexical scoping means we can't use let to override global variables, so use setq. (dabbrev--reset-global-variables): Reset new variable. (dabbrev--make-friend-buffer-list): Use new variable. * test/lisp/dabbrev-tests.el (dabbrev-completion-test): (dabbrev-completion-test-with-argument): New tests. --- lisp/dabbrev.el | 16 ++++++++++------ test/lisp/dabbrev-tests.el | 30 ++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el index 23abe7ae16..0cb9b0b824 100644 --- a/lisp/dabbrev.el +++ b/lisp/dabbrev.el @@ -323,6 +323,9 @@ dabbrev--last-case-pattern ;; Same as dabbrev-check-other-buffers, but is set for every expand. (defvar dabbrev--check-other-buffers dabbrev-check-other-buffers) +;; Same as dabbrev-check-all-buffers, but is set for every expand. +(defvar dabbrev--check-all-buffers dabbrev-check-all-buffers) + ;; The regexp for recognizing a character in an abbreviation. (defvar dabbrev--abbrev-char-regexp nil) @@ -380,10 +383,7 @@ dabbrev-completion then it searches *all* buffers." (interactive "*P") (dabbrev--reset-global-variables) - (let* ((dabbrev-check-other-buffers (and arg t)) - (dabbrev-check-all-buffers - (and arg (= (prefix-numeric-value arg) 16))) - (abbrev (dabbrev--abbrev-at-point)) + (let* ((abbrev (dabbrev--abbrev-at-point)) (beg (progn (search-backward abbrev) (point))) (end (progn (search-forward abbrev) (point))) (ignore-case-p (dabbrev--ignore-case-p abbrev)) @@ -420,6 +420,9 @@ dabbrev-completion (t (mapcar #'downcase completion-list))))))) (complete-with-action a list s p))))) + (setq dabbrev--check-other-buffers (and arg t)) + (setq dabbrev--check-all-buffers + (and arg (= (prefix-numeric-value arg) 16))) (completion-in-region beg end table))) ;;;###autoload @@ -623,7 +626,8 @@ dabbrev--reset-global-variables dabbrev--last-buffer-found nil dabbrev--abbrev-char-regexp (or dabbrev-abbrev-char-regexp "\\sw\\|\\s_") - dabbrev--check-other-buffers dabbrev-check-other-buffers)) + dabbrev--check-other-buffers dabbrev-check-other-buffers + dabbrev--check-all-buffers dabbrev-check-all-buffers)) (defun dabbrev--select-buffers () "Return a list of other buffers to search for a possible abbrev. @@ -772,7 +776,7 @@ dabbrev--make-friend-buffer-list ;; If dabbrev-check-all-buffers, tack on all the other ;; buffers at the end of the list, except those which are ;; specifically to be ignored. - (if dabbrev-check-all-buffers + (if dabbrev--check-all-buffers (setq list (append list (dabbrev-filter-elements diff --git a/test/lisp/dabbrev-tests.el b/test/lisp/dabbrev-tests.el index a6ab2e7201..d26362db3d 100644 --- a/test/lisp/dabbrev-tests.el +++ b/test/lisp/dabbrev-tests.el @@ -40,3 +40,33 @@ dabbrev-expand-test ;; M-/ SPC M-/ M-/ (execute-kbd-macro "\257 \257\257")) (should (string= (buffer-string) "ab x\nab y\nab y")))) + +(ert-deftest dabbrev-completion-test () + "Test for bug#17899. +dabbrev-completion should not look for expansions in other +buffers unless a prefix argument is used." + (with-temp-buffer + (insert "axy") + (with-temp-buffer + (insert "abc\na") + (goto-char 6) + (save-window-excursion + (set-window-buffer nil (current-buffer)) + ;; C-M-/ + (execute-kbd-macro [201326639])) + (should (string= (buffer-string) "abc\nabc"))))) + +(ert-deftest dabbrev-completion-test-with-argument () + "Test for bug#17899. +dabbrev-completion should not complete because it has found +multiple expansions." + (with-temp-buffer + (insert "axy") + (with-temp-buffer + (insert "abc\na") + (goto-char 6) + (save-window-excursion + (set-window-buffer nil (current-buffer)) + ;; C-u C-u C-M-/ + (execute-kbd-macro [21 21 201326639])) + (should (string= (buffer-string) "abc\na"))))) -- 2.21.0 --=-=-= Content-Type: text/plain -- Alan Third --=-=-=-- From unknown Sun Jun 22 00:11:32 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Stefan Guath Subject: bug#17899: closed (Re: bug#17899: 24.3.92.1; dabbrev-completion incorrectly searches all buffers) Message-ID: References: <20191210205406.GA61566@breton.holly.idiocy.org> X-Gnu-PR-Message: they-closed 17899 X-Gnu-PR-Package: emacs Reply-To: 17899@debbugs.gnu.org Date: Tue, 10 Dec 2019 20:55:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1576011302-31104-1" This is a multi-part message in MIME format... ------------=_1576011302-31104-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #17899: 24.3.92.1; dabbrev-completion incorrectly searches all buffers which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 17899@debbugs.gnu.org. --=20 17899: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D17899 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1576011302-31104-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 17899-done) by debbugs.gnu.org; 10 Dec 2019 20:54:19 +0000 Received: from localhost ([127.0.0.1]:56668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iemWQ-00084j-VO for submit@debbugs.gnu.org; Tue, 10 Dec 2019 15:54:19 -0500 Received: from mail-wm1-f42.google.com ([209.85.128.42]:55526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iemWN-00084U-O8 for 17899-done@debbugs.gnu.org; Tue, 10 Dec 2019 15:54:16 -0500 Received: by mail-wm1-f42.google.com with SMTP id q9so4733117wmj.5 for <17899-done@debbugs.gnu.org>; Tue, 10 Dec 2019 12:54:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=vgFwjzgGyb6322RFveOC4LK8bS0Vl9gjJ4y0v4Ndycc=; b=KEE2UFV6MHzEVZ1cD8DTRbsy099Mltupk3UuRaQV1rRPTXeSO6tD+TNqhMt5Gktl8K tfnl4DRg/vpB7K4EPmN77OY/DFpgmReH0yrWm/R/inI3g2D73M8PB+h0Zypu629vp5jF /Wy2zBiBXLNTJB9YYjSJ+MCyAiYz0A2gU0fElyxByUM1e1GaJv4vdP9H9e7jHOVWsZcM /ihRUI873PdONvLaBxvw0WTgrEBpHkUvdTWgLRqRqcxKDE3wRTPZ/AwG+nfj0NC6wxE5 JxqAVQLGSFsSJ4xkpkOll9STv206+hn7C6UGsocQESERxNzkkRbm31w28HAu2tauJGwf oeLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=vgFwjzgGyb6322RFveOC4LK8bS0Vl9gjJ4y0v4Ndycc=; b=hUnpYmrrt0LKjg+XANKKTwOot8wCf2uJiIlJc5lmMUvporNfTV1sPMPGwq9+aXT9n+ QaO5Wp1v2eGv6JoMJ5Cu9olCJ9AZxaFaJwfZ4zNGzedYRcOMewiI+fpC31KNX2z9RffV U8YQDmSe/muL8PTAhHL4mtx2tKwFpQy71k2/iFK2psXN479ClYjtnE9jHcheiZTzeHMY y4bEWNHn+j858Fn6F8O+2CprU1w1+NsC85bHdReytKNuYTEBf/ItdAElU9Cr3dmvvzTt X99/6mpQG0dHjfkzztBbpnA2vkTqOV2MFsNENAS5AYZZruzLHzP48pf9wMP2tY4hBHmi tXrQ== X-Gm-Message-State: APjAAAXVRARbtw4MijZyd88keK9HrpB3LueA0QD9UDbaruBNFHiO57/n 37T9VbwukKFBWBSLI2dCtansq4RjbjE= X-Google-Smtp-Source: APXvYqxKuhCIvlOERw2w3i8FqwaqaZlVXiH3V2oP6EGSC0hdMCoty2YXEvZBlZ/vbbvvKh/Vl0fn4A== X-Received: by 2002:a1c:1dc4:: with SMTP id d187mr7484779wmd.46.1576011249542; Tue, 10 Dec 2019 12:54:09 -0800 (PST) Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-8586-a56f-eccc-754e.holly.idiocy.org. [2001:8b0:3f8:8129:8586:a56f:eccc:754e]) by smtp.gmail.com with ESMTPSA id i5sm1668967wml.31.2019.12.10.12.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 12:54:08 -0800 (PST) Date: Tue, 10 Dec 2019 20:54:06 +0000 From: Alan Third To: Stefan Guath Subject: Re: bug#17899: 24.3.92.1; dabbrev-completion incorrectly searches all buffers Message-ID: <20191210205406.GA61566@breton.holly.idiocy.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 17899-done Cc: 17899-done@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: -0.5 (/) On Thu, Dec 05, 2019 at 01:19:13PM +0000, Alan Third wrote: > Stefan Guath writes: > > > TO REPRODUCE BUG: > > * emacs -Q > > * Create two buffers (C-x b) with the following contents: > > foo.el: "idris0 idris1" > > bar.el: "ideal0 ideal1" > > * Go to end of foo.el, write "id" and execute dabbrev-completion (C-M-/) > > > > EXPECTED RESULT > > "id" should complete to "idris". > > Hi, sorry it took so long for someone to look at this. > > I believe the attached patch fixes it. The problem seems to have been > switching dabbrev.el over to using lexical scoping. It was previously > using let* to temporarily override a couple of global variables, which > works with dynamic scoping, but not lexical. I’ve pushed to master and am therefore closing this bug report. -- Alan Third ------------=_1576011302-31104-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 2 Jul 2014 13:55:27 +0000 Received: from localhost ([127.0.0.1]:40125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X2L0P-0002bn-LW for submit@debbugs.gnu.org; Wed, 02 Jul 2014 09:55:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55168) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X2L0J-0002aQ-NI for submit@debbugs.gnu.org; Wed, 02 Jul 2014 09:55:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2L05-0003mR-EJ for submit@debbugs.gnu.org; Wed, 02 Jul 2014 09:55:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2L05-0003mG-Be for submit@debbugs.gnu.org; Wed, 02 Jul 2014 09:55:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2Kzw-0004wJ-Ak for bug-gnu-emacs@gnu.org; Wed, 02 Jul 2014 09:55:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2Kzn-0003b6-9b for bug-gnu-emacs@gnu.org; Wed, 02 Jul 2014 09:54:56 -0400 Received: from mail-la0-x22c.google.com ([2a00:1450:4010:c03::22c]:59819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2Kzn-0003au-0j for bug-gnu-emacs@gnu.org; Wed, 02 Jul 2014 09:54:47 -0400 Received: by mail-la0-f44.google.com with SMTP id ty20so7100070lab.31 for ; Wed, 02 Jul 2014 06:54:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:content-type:content-transfer-encoding:subject :message-id:date:to:mime-version; bh=fJpklCXLNdNyRGzJQ4soQRFxexB2CkhhEOdeLiS6OvU=; b=QgKTHAATr6AsWZ+UmSfdTH7b4+EHxajixSPGPl8vwOiVaXMn+sJPCmQ4duOkDGB6xV BuR7MTo27p1PYCh8pfC3tRATTfm8nvqr/UEuF+hPigazms2fcRAoTdFduKOzrSamPsIQ K/EH2AzTBAucZa2pfZW9LsUrbJ34yFcNysR5wNhFEA2qVEGBMYKX4RL5D1s1HL0Pq3Sw kIrTJZZAP/ueXafN6UPx8w2ivYsDe4rKk6FjXBEkg2lJun0MbK5xnGKUTQqVPvoYIkJI 7msFlSFS71sL8oC2EN/DWfKWXibrDCt+AS2BGBR4iLpTIlbX6KrcgBe+X4RiBKXFjmC8 YdCg== X-Received: by 10.152.37.99 with SMTP id x3mr2448020laj.55.1404309284806; Wed, 02 Jul 2014 06:54:44 -0700 (PDT) Received: from [192.168.0.11] (c213-89-126-209.bredband.comhem.se. [213.89.126.209]) by mx.google.com with ESMTPSA id j13sm11878070lab.39.2014.07.02.06.54.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Jul 2014 06:54:44 -0700 (PDT) From: Stefan Guath Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: 24.3.92.1; dabbrev-completion incorrectly searches all buffers Message-Id: Date: Wed, 2 Jul 2014 15:54:43 +0200 To: bug-gnu-emacs@gnu.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) X-Mailer: Apple Mail (2.1878.2) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -4.0 (----) VERSION: GNU Emacs 24.3.92.1 (x86_64-apple-darwin13.2.0, NS apple-appkit-1265.20) TO REPRODUCE BUG: * emacs -Q * Create two buffers (C-x b) with the following contents: foo.el: "idris0 idris1" bar.el: "ideal0 ideal1" * Go to end of foo.el, write "id" and execute dabbrev-completion (C-M-/) EXPECTED RESULT "id" should complete to "idris". The doc of dabbrev-completion is very = clear on this: "Like M-/ but finds all expansions in the current buffer and presents suggestions for completion. With a prefix argument ARG, it searches all buffers accepted by the function pointed out by `dabbrev-friend-buffer-function' to find the completions. If the prefix argument is 16 (which comes from C-u C-u), then it searches *all* buffers." No prefix was given here, so it should just look in the current buffer. ACTUAL RESULT A new buffer opens with the text: "In this buffer, type RET to select the completion near point. Possible completions are: ideal0 ideal1 idris0 idris1" Apparently, the buffer bar.el was incorrectly taken into account. After = killing buffer bar.el, dabbrev-completion completes as expected in = foo.el.= ------------=_1576011302-31104-1--