]> git.eshelyaron.com Git - emacs.git/commitdiff
* simple.el (undo): Prevent insertion of identity mapping into
authorBarry O'Reilly <gundaetiapo@gmail.com>
Sat, 12 Apr 2014 19:20:44 +0000 (15:20 -0400)
committerBarry O'Reilly <gundaetiapo@gmail.com>
Sat, 12 Apr 2014 19:20:44 +0000 (15:20 -0400)
undo-equiv-table so as undo-only does not inf loop in the presence
of consecutive nils in undo list.

Fixes: debbugs:17236
lisp/ChangeLog
lisp/simple.el

index e90693180a8746ebc9e84448144b04291ebdbc4d..f5f3208256e9debf9c4531efb9e4e8be4c84fd80 100644 (file)
@@ -1,3 +1,9 @@
+2014-04-12  Barry O'Reilly  <gundaetiapo@gmail.com>
+
+       * simple.el (undo): Prevent insertion of identity mapping into
+       undo-equiv-table so as undo-only does not inf loop in the presence
+       of consecutive nils in undo list.
+
 2014-04-12  Matthias Dahl  <matthias.dahl@binary-island.eu>
 
        * faces.el (make-face): Deprecate optional argument as it is no
index 68bfd7b14f4d62678c1241911ad45766088c2f82..a5e8381eaaaec3668f233497baf247fbc378677a 100644 (file)
@@ -2143,7 +2143,12 @@ as an argument limits undo to changes within the current region."
       ;; above when checking.
       (while (eq (car list) nil)
        (setq list (cdr list)))
-      (puthash list (if undo-in-region t pending-undo-list)
+      (puthash list
+               ;; Prevent identity mapping.  This can happen if
+               ;; consecutive nils are erroneously in undo list.
+               (if (or undo-in-region (eq list pending-undo-list))
+                   t
+                 pending-undo-list)
               undo-equiv-table))
     ;; Don't specify a position in the undo record for the undo command.
     ;; Instead, undoing this should move point to where the change is.