]> git.eshelyaron.com Git - emacs.git/commitdiff
(undo): Don't loop when encountering empty undo records.
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 14 Mar 2009 01:51:34 +0000 (01:51 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 14 Mar 2009 01:51:34 +0000 (01:51 +0000)
lisp/ChangeLog
lisp/simple.el

index acc2703044e1d230639c151a4fbd8877e2fc0fce..93956a4c25879015b611bdd40d8d258383ceeec3 100644 (file)
@@ -1,3 +1,7 @@
+2009-03-14  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * simple.el (undo): Don't loop when encountering empty undo records.
+
 2009-03-13  Tassilo Horn  <tassilo@member.fsf.org>
 
        * doc-view.el (doc-view-mode-map): Bind RET to image-next-line.
index 8ffe5912865d843efd1fcb4905d96b7c741eac47..d758fc1f0a7534874b22d06723bd1f2a721aca2c 100644 (file)
@@ -1682,9 +1682,13 @@ as an argument limits undo to changes within the current region."
     ;; In the ordinary case (not within a region), map the redo
     ;; record to the following undos.
     ;; I don't know how to do that in the undo-in-region case.
-    (puthash buffer-undo-list
-            (if undo-in-region t pending-undo-list)
-            undo-equiv-table)
+    (let ((list buffer-undo-list))
+      ;; Strip any leading undo boundaries there might be, like we do
+      ;; above when checking.
+      (while (eq (car list) nil)
+       (setq list (cdr list)))
+      (puthash list (if undo-in-region 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.
     (let ((tail buffer-undo-list)