GNU bug report logs - #23785
Emacs 25: "Undo" overdoes things.

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Fri, 17 Jun 2016 15:03:01 UTC

Severity: normal

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: phillip.lord <at> russet.org.uk (Phillip Lord)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: acm <at> muc.de, 23785 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: bug#23785: Emacs 25: 'Undo' overdoes things.
Date: Tue, 21 Jun 2016 15:29:47 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: phillip.lord <at> russet.org.uk (Phillip Lord)
>> Cc: "Eli Zaretskii" <eliz <at> gnu.org>,  acm <at> muc.de,  23785 <at> debbugs.gnu.org
>> Date: Mon, 20 Jun 2016 16:03:35 +0100
>> 
>> My suggestion: this patch goes to Emacs-25. And the previous patch
>> (which automatically adds an undo boundary to current-buffer regardless
>> of changes), goes to master.
>
> So can you please show the "previous" patch?  There were too many of
> them.


This one, to master.

>From 2ab1f314ad6fe0e68420cc510445495467d82b8f Mon Sep 17 00:00:00 2001
From: Phillip Lord <phillip.lord <at> russet.org.uk>
Date: Fri, 17 Jun 2016 22:34:50 +0100
Subject: [PATCH] Fix missing undo-boundary after revert-buffer

* lisp/simple.el (undo-auto--boundaries): Ensure an undo-boundary after
  every command whether it (apparently) changes the buffer or not.

Addresses Bug#23785
---
 lisp/simple.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/simple.el b/lisp/simple.el
index b66827d..3110430 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2875,6 +2875,10 @@ undo-auto--boundaries
   "Check recently changed buffers and add a boundary if necessary.
 REASON describes the reason that the boundary is being added; see
 `undo-last-boundary' for more information."
+  ;; (Bug #23785) All commands should ensure that there is an undo
+  ;; boundary whether they have changed the current buffer or not.
+  (when (eq cause 'command)
+    (add-to-list 'undo-auto--undoably-changed-buffers (current-buffer)))
   (dolist (b undo-auto--undoably-changed-buffers)
           (when (buffer-live-p b)
             (with-current-buffer b
-- 
2.8.4




This bug report was last modified 4 years and 261 days ago.

Previous Next


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