all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Alan Mackenzie <acm@muc.de>, 39680@debbugs.gnu.org
Subject: bug#39680: 27.0.60; electric-pair-mode broken by undo
Date: Tue, 10 Mar 2020 07:45:38 +0100	[thread overview]
Message-ID: <87o8t4vhbh.fsf@gmail.com> (raw)
In-Reply-To: <jwvimjd4dfr.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Mon, 09 Mar 2020 14:26:21 -0400")

Stefan Monnier <monnier@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!





  reply	other threads:[~2020-03-10  6:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-19 18:34 bug#39680: 27.0.60; electric-pair-mode broken by undo Kévin Le Gouguec
2020-02-25 19:34 ` Alan Mackenzie
2020-03-09 18:26   ` Stefan Monnier
2020-03-10  6:45     ` Kévin Le Gouguec [this message]
2020-03-11 15:31       ` Stefan Monnier
2020-03-11 16:20         ` Eli Zaretskii
2020-03-12 14:04           ` Stefan Monnier
     [not found]       ` <87d078ajzs.fsf@gmail.com>
     [not found]         ` <87blmstg0v.fsf@gmail.com>
     [not found]           ` <87blms6ww9.fsf@gmail.com>
     [not found]             ` <877dxgtae9.fsf@gmail.com>
2020-05-19 22:05               ` bug#39680: Test case Kévin Le Gouguec
2020-05-19 22:26                 ` Kévin Le Gouguec
2020-05-19 23:17                 ` João Távora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o8t4vhbh.fsf@gmail.com \
    --to=kevin.legouguec@gmail.com \
    --cc=39680@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.