GNU bug report logs - #39680
27.0.60; electric-pair-mode broken by undo

Previous Next

Package: emacs;

Reported by: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>

Date: Wed, 19 Feb 2020 18:35:01 UTC

Severity: normal

Found in version 27.0.60

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 39680 <at> debbugs.gnu.org (full text, mbox):

From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Alan Mackenzie <acm <at> muc.de>, 39680 <at> debbugs.gnu.org
Subject: Re: bug#39680: 27.0.60; electric-pair-mode broken by undo
Date: Tue, 10 Mar 2020 07:45:38 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> 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!




This bug report was last modified 5 years and 1 day ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.