From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Newsgroups: gmane.emacs.bugs Subject: bug#39680: 27.0.60; electric-pair-mode broken by undo Date: Tue, 10 Mar 2020 07:45:38 +0100 Message-ID: <87o8t4vhbh.fsf@gmail.com> References: <87pneaifya.fsf@gmail.com> <20200225193451.GA5896@ACM> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="57756"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Alan Mackenzie , 39680@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 10 07:46:22 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jBYek-000Etr-Dx for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 10 Mar 2020 07:46:22 +0100 Original-Received: from localhost ([::1]:54182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBYej-0005wZ-Ch for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 10 Mar 2020 02:46:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51955) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jBYeR-0005vr-GQ for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2020 02:46:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jBYeQ-0007TD-FP for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2020 02:46:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45771) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jBYeP-0007Qv-V8 for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2020 02:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jBYeP-0007p2-Rv for bug-gnu-emacs@gnu.org; Tue, 10 Mar 2020 02:46:01 -0400 X-Loop: help-debbugs@gnu.org 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 Original-Received: via spool by 39680-submit@debbugs.gnu.org id=B39680.158382274730044 (code B ref 39680); Tue, 10 Mar 2020 06:46:01 +0000 Original-Received: (at 39680) by debbugs.gnu.org; 10 Mar 2020 06:45:47 +0000 Original-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 Original-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 Original-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) Original-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) In-Reply-To: (Stefan Monnier's message of "Mon, 09 Mar 2020 14:26:21 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:177122 Archived-At: 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!