aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/simple.el
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2009-03-14 01:51:34 +0000
committerStefan Monnier <[email protected]>2009-03-14 01:51:34 +0000
commit86f0d932e50cce24409b5296ea2be45cad6f317e (patch)
tree70a286b05c1307eb517dffd2bb4a980b6d57f389 /lisp/simple.el
parent7dae1ce2622198a6b342d6c660b56a68734bf229 (diff)
(undo): Don't loop when encountering empty undo records.
Diffstat (limited to 'lisp/simple.el')
-rw-r--r--lisp/simple.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 8ffe591286..d758fc1f0a 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -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)