From unknown Thu Jun 19 16:24:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39680: 27.0.60; electric-pair-mode broken by undo Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Feb 2020 18:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39680 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 39680@debbugs.gnu.org Cc: Stefan Monnier X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.1582137291780 (code B ref -1); Wed, 19 Feb 2020 18:35:01 +0000 Received: (at submit) by debbugs.gnu.org; 19 Feb 2020 18:34:51 +0000 Received: from localhost ([127.0.0.1]:43365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4UBP-0000CU-5P for submit@debbugs.gnu.org; Wed, 19 Feb 2020 13:34:51 -0500 Received: from lists.gnu.org ([209.51.188.17]:49962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4UBM-0000CN-Ax for submit@debbugs.gnu.org; Wed, 19 Feb 2020 13:34:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59931) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4UBJ-00056c-UM for bug-gnu-emacs@gnu.org; Wed, 19 Feb 2020 13:34:47 -0500 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, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4UBH-0001Dg-PX for bug-gnu-emacs@gnu.org; Wed, 19 Feb 2020 13:34:45 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:36093) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j4UBH-0001BJ-Hs for bug-gnu-emacs@gnu.org; Wed, 19 Feb 2020 13:34:43 -0500 Received: by mail-wm1-x32f.google.com with SMTP id p17so1794000wma.1 for ; Wed, 19 Feb 2020 10:34:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lQ78N+KPxSay2au8vprKyJECNlBQFYy6DWqb3PO6r1w=; b=DJezC84B6rXGNEbLELUlWWDqoIkxELxlunVvcFjv5+HL/XQYdYi/hvFctylwp/NLAW WqBAwnrq6gnfeQIJ1880iK0v+S8/cNq3gzXjLGEK52jmP92aNVXDdN40FHyujoFUtJMU tA899iEr9Ap7ucsy1ukmetQbSHizeWR0egsMWrHs1qQ6S9+zJI23KkYFftAZ+PCNLt/h BKqeTqv4+CL1EVmT/o7TRRXIK8UoiDHtCS18CU0bxC2sGllXBhT55WWxWtBlmvZU6Ech CyeyEwTNo6ASH/Su6I0sw+4rR1O6pCygeBG1UxbtA8atuH/j2ZTFmlEE5BXTBxPE5VMr TgHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lQ78N+KPxSay2au8vprKyJECNlBQFYy6DWqb3PO6r1w=; b=iVJUUWb2Di7+BpTG5Cvi36n7rWPSr67TBSuqCRR9OErUXtpOU3mFKke5lsXVeUdl/Y rxSA5vhRCMCDS3ITDGzdx+1BUgY9ec1FGHtDexvN/DRtx1/lZPA3/DSRpFhVBZgrV6Pw QYdtIoLHwK1JcdbU/6WsymrNfqcKdQUSiw31NUiQabnXGRwGpK1BlrvuSqIEr7lgXDZQ iSiVRIhXqKL5Y8HOiwsImQWc7iFAJg9pjmoJBHTsW5Yphl+fPEVyaUey+BIMKoXmlEcP F+7oVrW5RO6++pCZ3n7Rim1k+csjBH5pteh5ehRBpXfFFedOHQ007t2devtQcwpaERjJ +SRQ== X-Gm-Message-State: APjAAAXD8IuhAFvG97w+AV4Qrw6mh5hylqhOSfu/5bOiZbLAbXrfnVEX LEcurRfLulRYIp4FUjldEs1C9mGF X-Google-Smtp-Source: APXvYqyuqvqD5JLELJTAj/pMYeRfTDIOd9a2lXZNg3EETD2/CKT/yd+0kzT7N86D9Xihy0tHIWZzNQ== X-Received: by 2002:a05:600c:24d2:: with SMTP id 18mr11496821wmu.149.1582137278755; Wed, 19 Feb 2020 10:34:38 -0800 (PST) Received: from my-little-tumbleweed (200.143.13.109.rev.sfr.net. [109.13.143.200]) by smtp.gmail.com with ESMTPSA id w8sm947496wmm.0.2020.02.19.10.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 10:34:37 -0800 (PST) From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Date: Wed, 19 Feb 2020 19:34:37 +0100 Message-ID: <87pneaifya.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32f X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello, Commit e66d5a1c45 (2019-02-19T00:00:44Z!monnier@iro.umontreal.ca) might have introduced a bug. From emacs -Q: 1. C-x b foo RET 2. M-x electric-pair-mode RET 3. ( - A closing parenthesis has been inserted. 4. C-b C-f - This is to break undo grouping. 5. a 6. C-_ 7. ( Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: umontreal.ca] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (kevin.legouguec[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [209.51.188.17 listed in list.dnswl.org] 2.0 SPOOFED_FREEMAIL No description available. 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.7 (/) Hello, Commit e66d5a1c45 (2019-02-19T00:00:44Z!monnier@iro.umontreal.ca) might have introduced a bug. From emacs -Q: 1. C-x b foo RET 2. M-x electric-pair-mode RET 3. ( - A closing parenthesis has been inserted. 4. C-b C-f - This is to break undo grouping. 5. a 6. C-_ 7. ( In Emacs 26.3, buffer foo contains "(())" and point is after the innermost opening bracket. In Emacs 27, buffer foo contains "()" and point is after the closing bracket. The *Messages* buffer shows: > cancel-change-group: Undoing to some unrelated state NB: this can be reproduced with other electric-pair characters, e.g. ". I found the bug in a Python buffer trying to write a tuple of strings: I opened a parenthesis, forgot to add quotes, wrote a string, hit undo, tried to insert a single quote=E2=80=A6 and got moved past the end parenthe= sis instead. I tried to write a non-regression test; unfortunately what I came up with does not catch this bug reliably: (ert-deftest electric-pair-undo-unrelated-state () (with-temp-buffer (buffer-enable-undo) (electric-pair-mode) (let ((last-command-event ?\()) (self-insert-command 1)) (undo-boundary) (insert "hi there") (undo) (let ((last-command-event ?\()) (self-insert-command 1)))) C-x C-e'ing the (with-temp-buffer =E2=80=A6) form only triggers the error o= nce every two evaluations, for some reason. Thank you for your time. In GNU Emacs 28.0.50 (build 5, x86_64-pc-linux-gnu, GTK+ Version 3.24.13, c= airo version 1.16.0) of 2020-02-19 built on my-little-tumbleweed Repository revision: e1e1bd8f85c53fea9f61b6ec99b461ddd93461b9 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12007000 System Description: openSUSE Tumbleweed Configured using: 'configure --with-xwidgets --with-cairo' From unknown Thu Jun 19 16:24:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39680: 27.0.60; electric-pair-mode broken by undo Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Feb 2020 19:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39680 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec , Stefan Monnier Cc: 39680@debbugs.gnu.org Received: via spool by 39680-submit@debbugs.gnu.org id=B39680.15826592989104 (code B ref 39680); Tue, 25 Feb 2020 19:35:02 +0000 Received: (at 39680) by debbugs.gnu.org; 25 Feb 2020 19:34:58 +0000 Received: from localhost ([127.0.0.1]:56142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j6fys-0002Mm-0Z for submit@debbugs.gnu.org; Tue, 25 Feb 2020 14:34:58 -0500 Received: from colin.muc.de ([193.149.48.1]:27816 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1j6fyo-0002Ma-K8 for 39680@debbugs.gnu.org; Tue, 25 Feb 2020 14:34:56 -0500 Received: (qmail 93093 invoked by uid 3782); 25 Feb 2020 19:34:52 -0000 Received: from acm.muc.de (p4FE15DA7.dip0.t-ipconnect.de [79.225.93.167]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 25 Feb 2020 20:34:51 +0100 Received: (qmail 6148 invoked by uid 1000); 25 Feb 2020 19:34:51 -0000 Date: Tue, 25 Feb 2020 19:34:51 +0000 Message-ID: <20200225193451.GA5896@ACM> References: <87pneaifya.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87pneaifya.fsf@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Kévin and Stefan. On Wed, Feb 19, 2020 at 19:34:37 +0100, Kévin Le Gouguec wrote: > Hello, > Commit e66d5a1c45 (2019-02-19T00:00:44Z!monnier@iro.umontreal.ca) might > have introduced a bug. From emacs -Q: > 1. C-x b foo RET > 2. M-x electric-pair-mode RET > 3. ( > - A closing parenthesis has been inserted. > 4. C-b C-f > - This is to break undo grouping. > 5. a > 6. C-_ > 7. ( > In Emacs 26.3, buffer foo contains "(())" and point is after the > innermost opening bracket. > In Emacs 27, buffer foo contains "()" and point is after the closing > bracket. The *Messages* buffer shows: > > cancel-change-group: Undoing to some unrelated state The cause of this bug is a bug in cancel-change-group, part of the atomic-change-group group of functions. The commit you (Kévin) refer to above substitutes atomic-change-group for a simple insertion and deletion of a character (for a good reason). cancel-change-group looks like this: (defun cancel-change-group (handle) "Finish a change group made with `prepare-change-group' (which see). This finishes the change group by reverting all of its changes." (dolist (elt handle) (with-current-buffer (car elt) (setq elt (cdr elt)) (save-restriction ;; Widen buffer temporarily so if the buffer was narrowed within ;; the body of `atomic-change-group' all changes can be undone. (widen) (let ((old-car (car-safe elt)) (old-cdr (cdr-safe elt))) (unwind-protect (progn ;; Temporarily truncate the undo log at ELT. (when (consp elt) (setcar elt nil) (setcdr elt nil)) (unless (eq last-command 'undo) (undo-start)) <======= ;; Make sure there's no confusion. ============> (when (and (consp elt) (not (eq elt (last pending-undo-list)))) (error "Undoing to some unrelated state")) ;; Undo it all. (save-excursion (while (listp pending-undo-list) (undo-more 1))) ;; Revert the undo info to what it was when we grabbed ;; the state. (setq buffer-undo-list elt)) ;; Reset the modified cons cell ELT to its original content. (when (consp elt) (setcar elt old-car) (setcdr elt old-cdr)))))))) On entry to this function, HANDLE has the value: ((# (2 . 3) nil ("a" . 2) (# . -1) nil (2 . 3))) . At the first indicated spot above, last-command is indeed 'undo, so undo-start is not invoked. Since the undo which undid "a" emptied pending-undo-list, pending-undo-list has been set to t. So when the eq is done in the second indicated spot, pending-undo-list is not ELT (the first cons cell from (cdr handle)). The function thus spuriously signals the error "Undoing to some unrelated state". ######################################################################### I admit I don't fully understand the mechanism of atomic-change-group, but I see the problem as the EQ comparison on the <======= line. If pending-undo-list has been replaced by t (after being exhausted by the previous 'undo operation), there is no point EQing it with the cons from HANDLE. So, as a first approximation to a fix, I added a (consp pending-undo-list) into this test, as follow: diff --git a/lisp/subr.el b/lisp/subr.el index b5ec0de156..8b7d9b5451 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2975,7 +2975,9 @@ cancel-change-group ;; Temporarily truncate the undo log at ELT. (when (consp elt) (setcar elt nil) (setcdr elt nil)) - (unless (eq last-command 'undo) (undo-start)) + (unless (and (eq last-command 'undo) + (consp pending-undo-list)) + (undo-start)) ;; Make sure there's no confusion. (when (and (consp elt) (not (eq elt (last pending-undo-list)))) (error "Undoing to some unrelated state")) Stefan, what is your view on this attempted patch? Is it sound? [ .... ] > Thank you for your time. Thank you for a good bug report, conveniently reduced to a minimum test case. > In GNU Emacs 28.0.50 (build 5, x86_64-pc-linux-gnu, GTK+ Version 3.24.13, cairo version 1.16.0) > of 2020-02-19 built on my-little-tumbleweed > Repository revision: e1e1bd8f85c53fea9f61b6ec99b461ddd93461b9 > Repository branch: master > Windowing system distributor 'The X.Org Foundation', version 11.0.12007000 > System Description: openSUSE Tumbleweed > Configured using: > 'configure --with-xwidgets --with-cairo' -- Alan Mackenzie (Nuremberg, Germany). From unknown Thu Jun 19 16:24:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39680: 27.0.60; electric-pair-mode broken by undo Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Mar 2020 18:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39680 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 39680@debbugs.gnu.org, =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Received: via spool by 39680-submit@debbugs.gnu.org id=B39680.158377839117623 (code B ref 39680); Mon, 09 Mar 2020 18:27:02 +0000 Received: (at 39680) by debbugs.gnu.org; 9 Mar 2020 18:26:31 +0000 Received: from localhost ([127.0.0.1]:51457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jBN6l-0004aA-10 for submit@debbugs.gnu.org; Mon, 09 Mar 2020 14:26:31 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:42091) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jBN6k-0004Zx-3e for 39680@debbugs.gnu.org; Mon, 09 Mar 2020 14:26:30 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id F1AF181234; Mon, 9 Mar 2020 14:26:23 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 1C3D9810A0; Mon, 9 Mar 2020 14:26:22 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1583778382; bh=Rqg1+sUNGh+Z4j6c3dWCKu9KxFEPr8VA0waeNcT4e5M=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=h7klIznnh9NNBdxyqLneoJmgwdIUbPyXaKitZs6vZcriibVsgYJ+NwZLvML1UJCWz Y1WfS/79CBB09WkK6pR5i+RagQ3H9pCA8RviehTDIn5g19ekNNF+Y1U/5v1/tIifRG 1IDY3NJjZVxixBXPBHdbR3wTJMNEb75hM2kHTecsK+4A0+RNHm5nIojxi2i4x+ddeu uhShPvhGd8ySjsAOxqaVFa/9aQF/JB8+N8FaZ5y9kQXoIgZgFFcJ9byVO/O5ZZtQUC 4hBFxdqyk/bj3l0F7XrN1Pb2wopz/JgtorKg+ZmNPg+jtV77RE7Zk0YwZ41OGoickz M3qZbgDdAidIA== Received: from alfajor (modemcable157.163-203-24.mc.videotron.ca [24.203.163.157]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id EFD6F1202FC; Mon, 9 Mar 2020 14:26:21 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87pneaifya.fsf@gmail.com> <20200225193451.GA5896@ACM> Date: Mon, 09 Mar 2020 14:26:21 -0400 In-Reply-To: <20200225193451.GA5896@ACM> (Alan Mackenzie's message of "Tue, 25 Feb 2020 19:34:51 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.109 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > The cause of this bug is a bug in cancel-change-group, Indeed. Thanks Alan for the nice analysis (and sorry I didn't get to it earlier). > (unless (eq last-command 'undo) (undo-start)) <======= > ;; Make sure there's no confusion. > ============> (when (and (consp elt) (not (eq elt (last pending-undo-list)))) > . At the first indicated spot above, last-command is indeed 'undo, so > undo-start is not invoked. I think there's a bug right here: the fact that the previous command was `undo` shouldn't really matter. Worse, we've made changes to the buffer since that last `undo` so it's plain wrong to pass that old `pending-undo-list` to `undo-more`. > Stefan, what is your view on this attempted patch? Is it sound? I think we need something like the patch below (not really tested yet). WDYT? >> Thank you for your time. > Thank you for a good bug report, conveniently reduced to a minimum test > case. Indeed. This is pretty delicate code, so a concise and easy to reproduce test case is very welcome. Stefan diff --git a/lisp/subr.el b/lisp/subr.el index 13515ca7da..ebc8e320dc 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2972,13 +2972,14 @@ cancel-change-group ;; the body of `atomic-change-group' all changes can be undone. (widen) (let ((old-car (car-safe elt)) - (old-cdr (cdr-safe elt))) + (old-cdr (cdr-safe elt)) + (start-pul pending-undo-list)) (unwind-protect (progn ;; Temporarily truncate the undo log at ELT. (when (consp elt) (setcar elt nil) (setcdr elt nil)) - (unless (eq last-command 'undo) (undo-start)) + (setq pending-undo-list buffer-undo-list) ;; Make sure there's no confusion. (when (and (consp elt) (not (eq elt (last pending-undo-list)))) (error "Undoing to some unrelated state")) @@ -2991,7 +2992,13 @@ cancel-change-group ;; Reset the modified cons cell ELT to its original content. (when (consp elt) (setcar elt old-car) - (setcdr elt old-cdr)))))))) + (setcdr elt old-cdr))) + ;; Let's not break a sequence of undos just because we + ;; tried to make a change and then undid it: preserve + ;; the original `pending-undo-list' if it's still valid. + (if (eq (undo--last-change-was-undo-p buffer-undo-list) + start-pul) + (setq pending-undo-list start-pul))))))) ;;;; Display-related functions. From unknown Thu Jun 19 16:24:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39680: 27.0.60; electric-pair-mode broken by undo Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Mar 2020 06:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39680 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Alan Mackenzie , 39680@debbugs.gnu.org Received: via spool by 39680-submit@debbugs.gnu.org id=B39680.158382274730044 (code B ref 39680); Tue, 10 Mar 2020 06:46:01 +0000 Received: (at 39680) by debbugs.gnu.org; 10 Mar 2020 06:45:47 +0000 Received: from localhost ([127.0.0.1]:51744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jBYeB-0007oW-Eo for submit@debbugs.gnu.org; Tue, 10 Mar 2020 02:45:47 -0400 Received: from mail-wm1-f49.google.com ([209.85.128.49]:40485) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jBYe9-0007oJ-O8 for 39680@debbugs.gnu.org; Tue, 10 Mar 2020 02:45:46 -0400 Received: by mail-wm1-f49.google.com with SMTP id e26so14364wme.5 for <39680@debbugs.gnu.org>; Mon, 09 Mar 2020 23:45:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=1BIZQeAuwWt60ZecmNR9/bzx3PXMlIIDEETwy5XbVU0=; b=BA3wMB1j7oZXEZa0u9A0gBjVwgGUmWJORGeLIjS8pBiMztsOy7slGnENXvj/H8blIK SDBMZ+udWwh2beOSqHzqK1qS89c2gcD2f+NEX314Exw6xQ/0Hsq4ovBdMz0vx6xyu9wY uk6Jmkq4jsFnjU1CbolkVjS9n0mxAoVIt9dytNIUxYmV8CC3S3BgwcFWB2daI9m7nEHC cREyYQGeWWfxmlsBpu7gh2Fhg79eexI98yQpUeY6cuBG8h1zXqubm1Kjc/aQJCTkPKaD ckvZVkSeALFM9EbfwMpzYG4hC0pXRbv3c8BftDQ4Ozj4gVEehacNoGunYq9i+QzGCTGI 2hdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=1BIZQeAuwWt60ZecmNR9/bzx3PXMlIIDEETwy5XbVU0=; b=BFFlx6lcuTkSfXvN/zIqRwU9R99EmsPhF9yfacynOMLJorxK1N1GyCpeKcpJbzCMSd Gz/G43Uag385vBsR/5bZvUvOCprL5ll7XLWt1lNmWeCt5SPd5W+vwWEyyOPhBGH1T//E /knyUGSP3orGDYLdA4VZEtH7SuO+59hepWbuWPGrLooKaSE2CW3TuggB+KTK6tUHBPmT AmkRtPJp2Z7EvqUNAO+NQHMquz/L7CCsi2jQeirKiSPQglXG36BLtuF66gv/3UEum4ZP SXDRBVECeucRL+ZgET2Q+DwmeUSxyxeyohL7Nvm3wZd7M0t80p2a6F8qy1kgofyhutqY c6Pg== X-Gm-Message-State: ANhLgQ2nX/oPOmEEgrLrMNXO1p9/8+BCLKJHLk2Ar3c5GXQhbBWLzvp5 4JGpzIe/wNEmHDbbqdoetvpf3ItUIAk= X-Google-Smtp-Source: ADFU+vtG+joF+nuFDLGZz668VmxfFqizFQQ34sZLO0GAP2QIP4XrmK2H9jZwBN0fyAESoyQy5saQYA== X-Received: by 2002:a1c:7e08:: with SMTP id z8mr324320wmc.166.1583822739587; Mon, 09 Mar 2020 23:45:39 -0700 (PDT) Received: from my-little-tumbleweed (200.143.13.109.rev.sfr.net. [109.13.143.200]) by smtp.gmail.com with ESMTPSA id w16sm31270102wrp.8.2020.03.09.23.45.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2020 23:45:38 -0700 (PDT) From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec References: <87pneaifya.fsf@gmail.com> <20200225193451.GA5896@ACM> Date: Tue, 10 Mar 2020 07:45:38 +0100 In-Reply-To: (Stefan Monnier's message of "Mon, 09 Mar 2020 14:26:21 -0400") Message-ID: <87o8t4vhbh.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: >> Stefan, what is your view on this attempted patch? Is it sound? > > I think we need something like the patch below (not really tested yet). > WDYT? FWIW, I applied it and AFAICT I can't reproduce the issue. >>> Thank you for your time. >> Thank you for a good bug report, conveniently reduced to a minimum test >> case. > > Indeed. This is pretty delicate code, so a concise and easy to reproduce > test case is very welcome. Happy to help. Though I wonder why my attempted ERT test only fails half the time. Reproduced here for context: (ert-deftest electric-pair-undo-unrelated-state () (with-temp-buffer (buffer-enable-undo) (electric-pair-mode) (let ((last-command-event ?\()) (self-insert-command 1)) (undo-boundary) (insert "hi there") (undo) (let ((last-command-event ?\()) (self-insert-command 1)))) With your patch, C-x C-e'ing the inner with-temp-buffer form once triggers no error (an "Undo" shows up in *Messages*); C-x C-e'ing a second time without moving point causes a "No further undo information" user error. At any rate, thanks for the fix! From unknown Thu Jun 19 16:24:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39680: 27.0.60; electric-pair-mode broken by undo Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Mar 2020 15:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39680 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Cc: Alan Mackenzie , 39680@debbugs.gnu.org Received: via spool by 39680-submit@debbugs.gnu.org id=B39680.15839407188089 (code B ref 39680); Wed, 11 Mar 2020 15:32:01 +0000 Received: (at 39680) by debbugs.gnu.org; 11 Mar 2020 15:31:58 +0000 Received: from localhost ([127.0.0.1]:55361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jC3Kv-00026P-Tu for submit@debbugs.gnu.org; Wed, 11 Mar 2020 11:31:58 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:27335) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jC3Kt-000261-Te for 39680@debbugs.gnu.org; Wed, 11 Mar 2020 11:31:56 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 4F24E80513; Wed, 11 Mar 2020 11:31:50 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 37ED8810B2; Wed, 11 Mar 2020 11:31:48 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1583940708; bh=Mfm7azjqy+E5iRpfACFg8aGEBX093lrlxwabYBKnWLY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=gpnSDadOx0oQfmRVdgCSg6ZiMzpq6J4H4rhMZ18e9ZxmRoA/KdhfSLVzMd2Ly07Zp Ky3CyH7VVfxCZlqVOpwsf+d8o9gp14kt1bPbCzmT1124+4J+I73hQDQu5mX/3LTHQd TaMBr1miXII4zzj4I8wV//SVl9ndT+KHXaeTLUVi69+KTauIy7Qx1/PsPo+Y6CoXP9 YiJqMyttQYHQ+DWyZBdccaqeb2lSrQ/SsjeAO4iAxxDbkd9LYBH47u8D6vVeNSMz9e Bi8DSMrFa9EfkBGczRAg52aHaeXPO9aijBkjcy+51ZJCdrlQaBAH8e2bX+JXjAPW/d ODh2wtL+zP27A== Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1F6D212066A; Wed, 11 Mar 2020 11:31:48 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87pneaifya.fsf@gmail.com> <20200225193451.GA5896@ACM> <87o8t4vhbh.fsf@gmail.com> Date: Wed, 11 Mar 2020 11:31:45 -0400 In-Reply-To: <87o8t4vhbh.fsf@gmail.com> ("=?UTF-8?Q?K=C3=A9vin?= Le Gouguec"'s message of "Tue, 10 Mar 2020 07:45:38 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.001 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> I think we need something like the patch below (not really tested yet). >> WDYT? > > FWIW, I applied it and AFAICT I can't reproduce the issue. Thanks. I think the patch wasn't quite right and was overly complicated: `undo` is already responsible for dealing with the freshness of `pending-undo-list`. So I think the better patch is the one below. Eli, is the patch below OK for `emacs-27`? Stefan [ BTW, I accidentally installed the previous patch on `master`, and I'm waiting for "the right solution" to clean up. ] diff --git a/lisp/subr.el b/lisp/subr.el index 5b94343e499..4c69c9dd044 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2964,13 +2964,18 @@ cancel-change-group ;; the body of `atomic-change-group' all changes can be undone. (widen) (let ((old-car (car-safe elt)) - (old-cdr (cdr-safe elt))) + (old-cdr (cdr-safe elt)) + ;; Use `pending-undo-list' temporarily since `undo-more' needs + ;; it, but restore it afterwards so as not to mess with an + ;; ongoing sequence of `undo's. + (pending-undo-list + ;; Use `buffer-undo-list' unconditionally (bug#39680). + buffer-undo-list)) (unwind-protect (progn ;; Temporarily truncate the undo log at ELT. (when (consp elt) (setcar elt nil) (setcdr elt nil)) - (unless (eq last-command 'undo) (undo-start)) ;; Make sure there's no confusion. (when (and (consp elt) (not (eq elt (last pending-undo-list)))) (error "Undoing to some unrelated state")) From unknown Thu Jun 19 16:24:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39680: 27.0.60; electric-pair-mode broken by undo Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Mar 2020 16:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39680 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: acm@muc.de, 39680@debbugs.gnu.org, kevin.legouguec@gmail.com Received: via spool by 39680-submit@debbugs.gnu.org id=B39680.158394361313211 (code B ref 39680); Wed, 11 Mar 2020 16:21:01 +0000 Received: (at 39680) by debbugs.gnu.org; 11 Mar 2020 16:20:13 +0000 Received: from localhost ([127.0.0.1]:55415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jC45d-0003R1-CO for submit@debbugs.gnu.org; Wed, 11 Mar 2020 12:20:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51207) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jC45b-0003Qg-EA for 39680@debbugs.gnu.org; Wed, 11 Mar 2020 12:20:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jC45V-0006OI-Jk; Wed, 11 Mar 2020 12:20:05 -0400 Received: from [176.228.60.248] (port=3830 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jC45U-0000LB-Ec; Wed, 11 Mar 2020 12:20:05 -0400 Date: Wed, 11 Mar 2020 18:20:09 +0200 Message-Id: <83eetyamo6.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Stefan Monnier on Wed, 11 Mar 2020 11:31:45 -0400) References: <87pneaifya.fsf@gmail.com> <20200225193451.GA5896@ACM> <87o8t4vhbh.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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 (-) > From: Stefan Monnier > Date: Wed, 11 Mar 2020 11:31:45 -0400 > Cc: Alan Mackenzie , 39680@debbugs.gnu.org > > Eli, is the patch below OK for `emacs-27`? Yes, thanks. From unknown Thu Jun 19 16:24:08 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: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Subject: bug#39680: closed (Re: bug#39680: 27.0.60; electric-pair-mode broken by undo) Message-ID: References: <87pneaifya.fsf@gmail.com> X-Gnu-PR-Message: they-closed 39680 X-Gnu-PR-Package: emacs Reply-To: 39680@debbugs.gnu.org Date: Thu, 12 Mar 2020 14:05:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1584021901-15202-1" This is a multi-part message in MIME format... ------------=_1584021901-15202-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #39680: 27.0.60; electric-pair-mode broken by undo 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 39680@debbugs.gnu.org. --=20 39680: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D39680 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1584021901-15202-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 39680-done) by debbugs.gnu.org; 12 Mar 2020 14:04:29 +0000 Received: from localhost ([127.0.0.1]:57604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jCORp-0003w9-0Y for submit@debbugs.gnu.org; Thu, 12 Mar 2020 10:04:29 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:39355) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jCORm-0003vv-SQ for 39680-done@debbugs.gnu.org; Thu, 12 Mar 2020 10:04:27 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 76BA5810A0; Thu, 12 Mar 2020 10:04:21 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E5ED180A1F; Thu, 12 Mar 2020 10:04:18 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1584021858; bh=y2QuA0yDbUQMIfXcydNtSpLEsdS1etGz/mTtzZlApbw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=CvOACgiV097eK/QXi6TG3u5T1LsiDJpsnhOOzr/BWYNUZhVhI/V5NH/icRI9dMujs FlTS5jVf9/AFiXlnUM8Jahl5SL8W6JjQCCfSrfkrFaFDeqFDKypAwrLYD12SyUSFMQ QvV9CB6tn93l7T/Y91YVudQmOx9bt1AmPM/CQ5sGfqwfIBBrVnDNA5VET5SZqnztIv CkXBMnnEEZAn/u3wjljmkj09t4nBgEboxegjuPSw7OEN9oRoXh84tu8cLSJ2S1SfdH Z8qN5EoY+i+NpNxAT87443ayTK4ACM5OPolYuzFm9EHgm5oa0R5F9KFXP26g/kZSOM XO7vi/GfFhb0A== Received: from alfajor (modemcable157.163-203-24.mc.videotron.ca [24.203.163.157]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C11F51205FB; Thu, 12 Mar 2020 10:04:18 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#39680: 27.0.60; electric-pair-mode broken by undo Message-ID: References: <87pneaifya.fsf@gmail.com> <20200225193451.GA5896@ACM> <87o8t4vhbh.fsf@gmail.com> <83eetyamo6.fsf@gnu.org> Date: Thu, 12 Mar 2020 10:04:11 -0400 In-Reply-To: <83eetyamo6.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 11 Mar 2020 18:20:09 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.111 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 39680-done Cc: acm@muc.de, 39680-done@debbugs.gnu.org, kevin.legouguec@gmail.com 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 (---) >> Eli, is the patch below OK for `emacs-27`? > Yes, thanks. Thanks, installed, Stefan ------------=_1584021901-15202-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 19 Feb 2020 18:34:51 +0000 Received: from localhost ([127.0.0.1]:43365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4UBP-0000CU-5P for submit@debbugs.gnu.org; Wed, 19 Feb 2020 13:34:51 -0500 Received: from lists.gnu.org ([209.51.188.17]:49962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4UBM-0000CN-Ax for submit@debbugs.gnu.org; Wed, 19 Feb 2020 13:34:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59931) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4UBJ-00056c-UM for bug-gnu-emacs@gnu.org; Wed, 19 Feb 2020 13:34:47 -0500 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, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4UBH-0001Dg-PX for bug-gnu-emacs@gnu.org; Wed, 19 Feb 2020 13:34:45 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:36093) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j4UBH-0001BJ-Hs for bug-gnu-emacs@gnu.org; Wed, 19 Feb 2020 13:34:43 -0500 Received: by mail-wm1-x32f.google.com with SMTP id p17so1794000wma.1 for ; Wed, 19 Feb 2020 10:34:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lQ78N+KPxSay2au8vprKyJECNlBQFYy6DWqb3PO6r1w=; b=DJezC84B6rXGNEbLELUlWWDqoIkxELxlunVvcFjv5+HL/XQYdYi/hvFctylwp/NLAW WqBAwnrq6gnfeQIJ1880iK0v+S8/cNq3gzXjLGEK52jmP92aNVXDdN40FHyujoFUtJMU tA899iEr9Ap7ucsy1ukmetQbSHizeWR0egsMWrHs1qQ6S9+zJI23KkYFftAZ+PCNLt/h BKqeTqv4+CL1EVmT/o7TRRXIK8UoiDHtCS18CU0bxC2sGllXBhT55WWxWtBlmvZU6Ech CyeyEwTNo6ASH/Su6I0sw+4rR1O6pCygeBG1UxbtA8atuH/j2ZTFmlEE5BXTBxPE5VMr TgHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lQ78N+KPxSay2au8vprKyJECNlBQFYy6DWqb3PO6r1w=; b=iVJUUWb2Di7+BpTG5Cvi36n7rWPSr67TBSuqCRR9OErUXtpOU3mFKke5lsXVeUdl/Y rxSA5vhRCMCDS3ITDGzdx+1BUgY9ec1FGHtDexvN/DRtx1/lZPA3/DSRpFhVBZgrV6Pw QYdtIoLHwK1JcdbU/6WsymrNfqcKdQUSiw31NUiQabnXGRwGpK1BlrvuSqIEr7lgXDZQ iSiVRIhXqKL5Y8HOiwsImQWc7iFAJg9pjmoJBHTsW5Yphl+fPEVyaUey+BIMKoXmlEcP F+7oVrW5RO6++pCZ3n7Rim1k+csjBH5pteh5ehRBpXfFFedOHQ007t2devtQcwpaERjJ +SRQ== X-Gm-Message-State: APjAAAXD8IuhAFvG97w+AV4Qrw6mh5hylqhOSfu/5bOiZbLAbXrfnVEX LEcurRfLulRYIp4FUjldEs1C9mGF X-Google-Smtp-Source: APXvYqyuqvqD5JLELJTAj/pMYeRfTDIOd9a2lXZNg3EETD2/CKT/yd+0kzT7N86D9Xihy0tHIWZzNQ== X-Received: by 2002:a05:600c:24d2:: with SMTP id 18mr11496821wmu.149.1582137278755; Wed, 19 Feb 2020 10:34:38 -0800 (PST) Received: from my-little-tumbleweed (200.143.13.109.rev.sfr.net. [109.13.143.200]) by smtp.gmail.com with ESMTPSA id w8sm947496wmm.0.2020.02.19.10.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 10:34:37 -0800 (PST) From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= To: bug-gnu-emacs@gnu.org Subject: 27.0.60; electric-pair-mode broken by undo Date: Wed, 19 Feb 2020 19:34:37 +0100 Message-ID: <87pneaifya.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32f X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello, Commit e66d5a1c45 (2019-02-19T00:00:44Z!monnier@iro.umontreal.ca) might have introduced a bug. From emacs -Q: 1. C-x b foo RET 2. M-x electric-pair-mode RET 3. ( - A closing parenthesis has been inserted. 4. C-b C-f - This is to break undo grouping. 5. a 6. C-_ 7. ( Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: umontreal.ca] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (kevin.legouguec[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [209.51.188.17 listed in list.dnswl.org] 2.0 SPOOFED_FREEMAIL No description available. X-Debbugs-Envelope-To: submit Cc: Stefan Monnier 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.7 (/) Hello, Commit e66d5a1c45 (2019-02-19T00:00:44Z!monnier@iro.umontreal.ca) might have introduced a bug. From emacs -Q: 1. C-x b foo RET 2. M-x electric-pair-mode RET 3. ( - A closing parenthesis has been inserted. 4. C-b C-f - This is to break undo grouping. 5. a 6. C-_ 7. ( In Emacs 26.3, buffer foo contains "(())" and point is after the innermost opening bracket. In Emacs 27, buffer foo contains "()" and point is after the closing bracket. The *Messages* buffer shows: > cancel-change-group: Undoing to some unrelated state NB: this can be reproduced with other electric-pair characters, e.g. ". I found the bug in a Python buffer trying to write a tuple of strings: I opened a parenthesis, forgot to add quotes, wrote a string, hit undo, tried to insert a single quote=E2=80=A6 and got moved past the end parenthe= sis instead. I tried to write a non-regression test; unfortunately what I came up with does not catch this bug reliably: (ert-deftest electric-pair-undo-unrelated-state () (with-temp-buffer (buffer-enable-undo) (electric-pair-mode) (let ((last-command-event ?\()) (self-insert-command 1)) (undo-boundary) (insert "hi there") (undo) (let ((last-command-event ?\()) (self-insert-command 1)))) C-x C-e'ing the (with-temp-buffer =E2=80=A6) form only triggers the error o= nce every two evaluations, for some reason. Thank you for your time. In GNU Emacs 28.0.50 (build 5, x86_64-pc-linux-gnu, GTK+ Version 3.24.13, c= airo version 1.16.0) of 2020-02-19 built on my-little-tumbleweed Repository revision: e1e1bd8f85c53fea9f61b6ec99b461ddd93461b9 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12007000 System Description: openSUSE Tumbleweed Configured using: 'configure --with-xwidgets --with-cairo' ------------=_1584021901-15202-1-- From debbugs-submit-bounces@debbugs.gnu.org Wed May 13 06:08:40 2020 Received: (at control) by debbugs.gnu.org; 13 May 2020 10:08:40 +0000 Received: from localhost ([127.0.0.1]:57435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYoJb-0005oh-Sh for submit@debbugs.gnu.org; Wed, 13 May 2020 06:08:40 -0400 Received: from mail-wr1-f44.google.com ([209.85.221.44]:40307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYoJa-0005oO-CA; Wed, 13 May 2020 06:08:38 -0400 Received: by mail-wr1-f44.google.com with SMTP id e16so20133090wra.7; Wed, 13 May 2020 03:08:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=RGxU2jtLgwk3NInitcGLs2nFRLyDXfN9ZZF7mX0w8/k=; b=UAZU1ySFDzEvWcziyH/FFNKxLpY8mjQacbh0KZVSHPjquiULiZZ8qaZUOqtAqlXMun iaSLYvKfjG7yMANz/CZoII1X4up10jOjoB00GTzTOalpiGHjY5Vc1JYSVfXsktgTGf0o /vakQaAZxK8yJlJz0ZQvBCtvByPvpg3DwZsONDg7CJDXwrL17HQNnbNkWQhZqKtxu70o Kneg1hxpth0kLhXCEQj4K5Fw69RjNcF5b1TA7LBOYYMLu+IcQ421S++YxE86gqaMIQQP SFsMJD4II6FoAE89+16/GpcsJNLU3inxSafjB2xYm7+GTYMDoYD5ULv7UWa38ghVHJZd nawA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=RGxU2jtLgwk3NInitcGLs2nFRLyDXfN9ZZF7mX0w8/k=; b=SnoAsSUiEJh7pgYuLzfF572xE4ox4Eqrre6Lt8TFuvD17eHWzaCygq2KgP2HE3PP/v ubWLkSwI2KHawLNfSyuz+9tmtbzQojClqmi46m/hbEUePy+UtyLuhzR3PSUhcsS+ah2p DCaL/n4UnZRr5hYxSas0UYVf1/kCt4H1UBGRaqvOCY3L+P+83LZgZEATeGpnUMg1WMAi WgBzqL3hhLtuphYS1tu9Rbw/bpgp5n54eBU3PBRECbesoRoDejptSFgBpGwgpeBYZ+bc qDBtiHPgYLlkf23KJieBOZsMOmpEUBg3pgoc3TlRwPu/P0xzfxHXZ/30UcjCqEjBgIHv dCaQ== X-Gm-Message-State: AGi0PuYj61FYsiAOlEWD5bQaeQNfv6bD0PKa3mvYCsiYhDedai5M685Y PtDw7fKR9jk9XRw50RG1NH/3Y9Puf4W+qw== X-Google-Smtp-Source: APiQypLUQRy4a0bcTwoi7vguRvyAuwdXIxRGBagtndHF7G36STHd/v/FbefP857ZOUA6KlXbkq1CUA== X-Received: by 2002:adf:a3c5:: with SMTP id m5mr23438496wrb.390.1589364512121; Wed, 13 May 2020 03:08:32 -0700 (PDT) Received: from my-little-tumbleweed (200.143.13.109.rev.sfr.net. [109.13.143.200]) by smtp.gmail.com with ESMTPSA id y3sm26278337wrm.64.2020.05.13.03.08.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 03:08:31 -0700 (PDT) From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: Re: bug#39680: 27.0.60; electric-pair-mode broken by undo References: <87pneaifya.fsf@gmail.com> <20200225193451.GA5896@ACM> <87o8t4vhbh.fsf@gmail.com> <87d078ajzs.fsf@gmail.com> <87blmstg0v.fsf@gmail.com> <87blms6ww9.fsf@gmail.com> Date: Wed, 13 May 2020 12:08:30 +0200 In-Reply-To: <87blms6ww9.fsf@gmail.com> (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vor?= =?utf-8?Q?a=22's?= message of "Wed, 13 May 2020 09:51:02 +0100") Message-ID: <877dxgtae9.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control Cc: Alan Mackenzie , control@debbugs.gnu.org, Stefan Monnier , 39680@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.0 (-) unarchive 39680 thanks Jo=C3=A3o T=C3=A1vora writes: > If you see this consistently failing when you revert the earlier fix and > passing now, I'd just add it to test/lisp/electric-tests.el. Thank you for prompting me to check; infuriatingly, this test does *not* fail when reverting Stefan's fix, although the manual recipe (39680#5) fails consistently. Obviously I'm missing something and the test needs more work. > A short > docstring summarily explaining what is being tested is useful. Or maybe > not, I think can read it without it. FWIW I've added a docstring and moved the test to electric-tests.el, right after the "backspacing" tests. diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el index 6334c62a31..d259f31a4c 100644 --- a/test/lisp/electric-tests.el +++ b/test/lisp/electric-tests.el @@ -545,6 +545,22 @@ js-mode-braces-with-layout-and-indent (goto-char 2) (electric-pair-delete-pair 1) (should (equal "" (buffer-string)))))) + +;;; Undoing +(ert-deftest electric-pair-undo-unrelated-state () + "Make sure `undo' does not get confused by `electric-pair-mode' (bug#396= 80)." + (with-temp-buffer + (buffer-enable-undo) + (electric-pair-local-mode) + (let ((last-command-event ?\()) + (self-insert-command 1)) + (undo-boundary) + (insert "a") + (undo-boundary) + (call-interactively #'undo) + (let ((last-command-event ?\()) + (self-insert-command 1)) + (should (string=3D (buffer-string) "(())")))) =20 ;;; Electric newlines between pairs From unknown Thu Jun 19 16:24:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39680: Test case Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 May 2020 22:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39680 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: Alan Mackenzie , control@debbugs.gnu.org, Stefan Monnier , 39680@debbugs.gnu.org Received: via spool by 39680-submit@debbugs.gnu.org id=B39680.15899259294813 (code B ref 39680); Tue, 19 May 2020 22:06:01 +0000 Received: (at 39680) by debbugs.gnu.org; 19 May 2020 22:05:29 +0000 Received: from localhost ([127.0.0.1]:51319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jbAMa-0001FU-Jf for submit@debbugs.gnu.org; Tue, 19 May 2020 18:05:28 -0400 Received: from mail-wr1-f44.google.com ([209.85.221.44]:45055) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jbAMY-0001FC-Nu; Tue, 19 May 2020 18:05:27 -0400 Received: by mail-wr1-f44.google.com with SMTP id 50so1037738wrc.11; Tue, 19 May 2020 15:05:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=QNKNVAxA7Qw2YW0ZbrnV45YljtflGCrvEjgq0GhXIjI=; b=Z1RhnGpMTC347jR+87xyRG6kfKwOP62256Y0KQi7VH6KdWNVkJGfyN6WlSI99VJYnO b4ZOQwnirEHTgzigs4wS6keEZ/1eyTH2a4oBqT6zFMgOJ8WbBRiAP2xVeML8sxqbStnG LH3Ldh9UAmK7c3+jlWAvSFKl+5YU7gx2cSgX+a2/igGZUcAjfoSWnfbiq1E7eYiSo5i2 RZ1LMvr+NpmPTEEAtKfxfCtFhDLPlvlQrYu55Tfogsl/Gih+Bzx24SgFMAThJuAbetIE Cvnzu1QPIp46stm8Rw36Xm4c3lMcPaC4FRgrk6xwQhnZ7woNXPJ8VDdQt1mZz//oMRqW WrcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=QNKNVAxA7Qw2YW0ZbrnV45YljtflGCrvEjgq0GhXIjI=; b=EKG+LV7tr51zejN85EKIzcUY5ylwuzL8ZedA585OSjItWzmzjn5DNwDBVnrdSeDnZO wj9rMzci2G+LKVuKFGK0fXgaT8jBr4Q0e3Ue6ZkD0LPKdDwQDjkfGkdtuyTzDwWJw5g9 x4nqHxR1UI+Ennuk1MSKgbWlE4AHtXcgHGCr9AAZDpRPczG+Gt1vG25xQm5wjjqqu2Be Sr6RU/4vH7rPovUrh63iTuz3FbWapENdTZMdTdrgCFcN49RLoGf6iDk/s5tTpLoPxD3L U7wbQlehZc9/khZVKKfBC2PbsOBFKEtGPSHh77vRXnwGZX25XZu9rAgaWkNePi/0V/na ORJw== X-Gm-Message-State: AOAM533KSwASxRyFkCmUJ5KDZY7l/8YGG8ESDzrdrX8R7kd5svthpeKj at+yLRJsrsHHECMi6LgtFDt6bgnbAHnD/g== X-Google-Smtp-Source: ABdhPJwvIhJyh7U7CWtdllb5l1HczrsjCCSjTGwJXyj9Ph+8b4PWcKfmHDrpE1bVYkb9P056b3F8PQ== X-Received: by 2002:a5d:6108:: with SMTP id v8mr942956wrt.286.1589925920523; Tue, 19 May 2020 15:05:20 -0700 (PDT) Received: from my-little-tumbleweed (200.143.13.109.rev.sfr.net. [109.13.143.200]) by smtp.gmail.com with ESMTPSA id j16sm789357wru.13.2020.05.19.15.05.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 15:05:19 -0700 (PDT) From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec References: <87pneaifya.fsf@gmail.com> <20200225193451.GA5896@ACM> <87o8t4vhbh.fsf@gmail.com> <87d078ajzs.fsf@gmail.com> <87blmstg0v.fsf@gmail.com> <87blms6ww9.fsf@gmail.com> <877dxgtae9.fsf@gmail.com> Date: Wed, 20 May 2020 00:05:18 +0200 In-Reply-To: <877dxgtae9.fsf@gmail.com> ("=?UTF-8?Q?K=C3=A9vin?= Le Gouguec"'s message of "Wed, 13 May 2020 12:08:30 +0200") Message-ID: <87tv0bfun5.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Finally nailed it, after finding out about ert-simulate-command. The following patch adds a test that passes on master and emacs-27, and "successfully fails" when reverting Stefan's fix (commit c1ce9fa7f2). --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-test-for-bug-39680.patch >From c83fbd50f0f0999814f09706fc908df5c22c5a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= Date: Tue, 19 May 2020 23:17:04 +0200 Subject: [PATCH] Add test for bug#39680 * test/lisp/electric-tests.el (electric-pair-undo-unrelated-state): New test. --- test/lisp/electric-tests.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el index 56d1bdb110..67f474cbd5 100644 --- a/test/lisp/electric-tests.el +++ b/test/lisp/electric-tests.el @@ -546,6 +546,24 @@ js-mode-braces-with-layout-and-indent (electric-pair-delete-pair 1) (should (equal "" (buffer-string)))))) + +;;; Undoing +(ert-deftest electric-pair-undo-unrelated-state () + "Make sure `electric-pair-mode' does not confuse `undo' (bug#39680)." + (with-temp-buffer + (buffer-enable-undo) + (electric-pair-local-mode) + (let ((last-command-event ?\()) + (ert-simulate-command '(self-insert-command 1))) + (undo-boundary) + (let ((last-command-event ?a)) + (ert-simulate-command '(self-insert-command 1))) + (undo-boundary) + (ert-simulate-command '(undo)) + (let ((last-command-event ?\()) + (ert-simulate-command '(self-insert-command 1))) + (should (string= (buffer-string) "(())")))) + ;;; Electric newlines between pairs ;;; TODO: better tests -- 2.26.2 --=-=-=-- From unknown Thu Jun 19 16:24:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39680: Test case Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 May 2020 22:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39680 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: Alan Mackenzie , Stefan Monnier , 39680@debbugs.gnu.org Received: via spool by 39680-submit@debbugs.gnu.org id=B39680.158992721215021 (code B ref 39680); Tue, 19 May 2020 22:27:02 +0000 Received: (at 39680) by debbugs.gnu.org; 19 May 2020 22:26:52 +0000 Received: from localhost ([127.0.0.1]:51360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jbAhI-0003uD-4d for submit@debbugs.gnu.org; Tue, 19 May 2020 18:26:52 -0400 Received: from mail-wm1-f46.google.com ([209.85.128.46]:36675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jbAhG-0003u0-4a for 39680@debbugs.gnu.org; Tue, 19 May 2020 18:26:50 -0400 Received: by mail-wm1-f46.google.com with SMTP id u188so913004wmu.1 for <39680@debbugs.gnu.org>; Tue, 19 May 2020 15:26:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=qHmvKNxEHshL4LZUaILFLrz9FPZNLLepHwMnKbldRBw=; b=YQlsub3lz09W2QACWYQDsy0ehzyPT7W4YzwGnvjO2XoAF48ReaA4C8x3imcwk92POJ JgJslI4ATFl9p0Bh4/huhJYseI0imTMmoa6XxcR1FAzz6R+Tc7VcinWdGy9K24yWXqtX wlh0AKKaozIsXxngJ8BBd5jGUnTIaMmyNYkJKUmWOFo+PgoXWgXJFl11qvP06PnLMVLl 6mRyeuYnQLbvf1PVKfbFSyNZvlkvUwa1mTqVcSxnOugmVet1jFwji7SAqhfjLblD6eBx aaztbaV1/Dvs+idEzukPCWwOem1UoA5eWhm1bJPWgjXMuRiBwbmQABFNTIo13xpb1X6Q wlSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=qHmvKNxEHshL4LZUaILFLrz9FPZNLLepHwMnKbldRBw=; b=oPE5tM4DVwaMgc4TxKpa9fP5M1qr/9yJbHs0LQlwew5R7X5DKyQbTFODVDsol/OFR2 NoDKA9RSiX17WVvMvAnUeDL/Y4RyZHtay9UybILF8mIYnSRmdmP6xfMdY+uuhHEuXLjF Tax/L4u3L8s/dlUPyvfYPEaFcKMDz6usvjb1M1aNzFgSWR5QG3iiPFNtcUJLSAJKWGh2 AoVHTMVPti78UwWzDKL0cVpJcnTltFH7iQrCOP6o0j78T+mRNDSKqc2sItywUwkecVi/ +eyvM5O3Cph/H5+12HaKNhxvi/GSRXSWjiYosUZm0Z6yI7BIc5NjwtBkfUSsSrTBobd6 8EsA== X-Gm-Message-State: AOAM533jjVweIiy6KoNp97MsI/UkzQrt4SRKH8VzkEHCO4/v7XaLlN7/ f6vy34SXiwiESxQCUTdUwmOkKsTsrAdQAg== X-Google-Smtp-Source: ABdhPJxVhX5uiSyyDf/j0fNUjeGYdDOZ+AYi+bGyFnl2VlBGXUnK/RmGdGeFHaxLF3LeROXWfImsPA== X-Received: by 2002:a7b:c8d2:: with SMTP id f18mr1508687wml.174.1589927203808; Tue, 19 May 2020 15:26:43 -0700 (PDT) Received: from my-little-tumbleweed (200.143.13.109.rev.sfr.net. [109.13.143.200]) by smtp.gmail.com with ESMTPSA id 94sm900772wrf.74.2020.05.19.15.26.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 15:26:43 -0700 (PDT) From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec References: <87pneaifya.fsf@gmail.com> <20200225193451.GA5896@ACM> <87o8t4vhbh.fsf@gmail.com> <87d078ajzs.fsf@gmail.com> <87blmstg0v.fsf@gmail.com> <87blms6ww9.fsf@gmail.com> <877dxgtae9.fsf@gmail.com> <87tv0bfun5.fsf_-_@gmail.com> Date: Wed, 20 May 2020 00:26:42 +0200 In-Reply-To: <87tv0bfun5.fsf_-_@gmail.com> ("=?UTF-8?Q?K=C3=A9vin?= Le Gouguec"'s message of "Wed, 20 May 2020 00:05:18 +0200") Message-ID: <87d06zftnh.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 (-) (Removing control@debbugs.gnu.org from the CC list; sorry for this blunder.) K=C3=A9vin Le Gouguec writes: > Finally nailed it, after finding out about ert-simulate-command. > > The following patch adds a test that passes on master and emacs-27, and > "successfully fails" when reverting Stefan's fix (commit c1ce9fa7f2). From unknown Thu Jun 19 16:24:08 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39680: Test case Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 May 2020 23:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39680 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Cc: Alan Mackenzie , control@debbugs.gnu.org, Stefan Monnier , 39680@debbugs.gnu.org Received: via spool by 39680-submit@debbugs.gnu.org id=B39680.158993025119868 (code B ref 39680); Tue, 19 May 2020 23:18:02 +0000 Received: (at 39680) by debbugs.gnu.org; 19 May 2020 23:17:31 +0000 Received: from localhost ([127.0.0.1]:51499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jbBUI-0005AM-Up for submit@debbugs.gnu.org; Tue, 19 May 2020 19:17:31 -0400 Received: from mail-wm1-f53.google.com ([209.85.128.53]:35333) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jbBUC-00059P-I7; Tue, 19 May 2020 19:17:25 -0400 Received: by mail-wm1-f53.google.com with SMTP id n5so1015534wmd.0; Tue, 19 May 2020 16:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-transfer-encoding; bh=fLctBOlgbmZjQoAGIZtNgjqjHJt1VEiod4bvOpEFWu0=; b=ehXB2l9btck1mgHZdFYz3PoJ+DPDD6E/MjrOvBVWpcvo7urLVH+bN2L5gc2zdUStLW Up7wxox8ZfurGYHqInxRe2bR3DBVa2A4OV04EnOcRJaqyZbm4sOGaxL6tIqEhfSgL0Vr N4oVoG77/3zGSLyn85IsEaBgbJqiXeu0FaKPY5oCSnJ7/ci07X5Toam88x3K37K11nmt REx2he6INNul8V56j/mL24hI9iAG0pTAlu7L2zoNEkGVUYqLaD/yRdkbMAAWreWK8+aG FVDw2GcrN6P/QCg5SryMPwWvbGb/jneRfxY0jRU4+JtEZ6LeRYVv+AqBTa27f9BZKx2s KLlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-transfer-encoding; bh=fLctBOlgbmZjQoAGIZtNgjqjHJt1VEiod4bvOpEFWu0=; b=sdwuOkI7KNk2lBdcuLZrLSgAr8LCvjoIcRHNjC+9ijYeVKwR6jB426k1fc6VSiPVpH J4zkHdRbWdUE5DlqSHdtY4jHppeENX8nspIGPtM53DlP2kqJw2Uf+X07pVMLp0DqsFfF np0HiSkFVvcqQSoOCe3GxrGamzi2T2T8aXTiFyA5DCkmBuazvFeE2D/GNxd4Q44jStgE MCYcfKIOMBzwN0vzXdBFl4HqCFRg+DavOE18BvYF0HPPEyKaE9CMeRrKJ6JdAiWK6rIm 8tmiVFKhORGx/enaOLkrfqSwQ8xy8j8+OR4RsQ/rKpn0h2T2m12HqnwUUIxrl2K2C+PM t+XA== X-Gm-Message-State: AOAM530dCxyQh0KCW7l/Ex3L4ORoG19pCDcteuDmZHmhkBjhXmqTYqP/ WbuYfGMHPoClpxkblHdxx4xvd+xTjI61XQ== X-Google-Smtp-Source: ABdhPJzdpETrF0wrceI1oL/JrYPI5QIOVe3e3sYuN5FLG2sOzWGbITE9QEk1tvAmriVrAqHTbh+F+A== X-Received: by 2002:a1c:6287:: with SMTP id w129mr1749588wmb.151.1589930238246; Tue, 19 May 2020 16:17:18 -0700 (PDT) Received: from krug ([89.180.150.4]) by smtp.gmail.com with ESMTPSA id r9sm1213865wmg.47.2020.05.19.16.17.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 16:17:15 -0700 (PDT) From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= In-Reply-To: <87tv0bfun5.fsf_-_@gmail.com> ("=?UTF-8?Q?K=C3=A9vin?= Le Gouguec"'s message of "Wed, 20 May 2020 00:05:18 +0200") References: <87pneaifya.fsf@gmail.com> <20200225193451.GA5896@ACM> <87o8t4vhbh.fsf@gmail.com> <87d078ajzs.fsf@gmail.com> <87blmstg0v.fsf@gmail.com> <87blms6ww9.fsf@gmail.com> <877dxgtae9.fsf@gmail.com> <87tv0bfun5.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.91 (gnu/linux) Date: Wed, 20 May 2020 00:17:13 +0100 Message-ID: <87k1177bwm.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 (-) K=C3=A9vin Le Gouguec writes: > Finally nailed it, after finding out about ert-simulate-command. > > The following patch adds a test that passes on master and emacs-27, and > "successfully fails" when reverting Stefan's fix (commit c1ce9fa7f2). Thanks! pushed to master. Jo=C3=A3o