diff options
| author | Stefan Monnier | 2009-03-14 01:51:34 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2009-03-14 01:51:34 +0000 |
| commit | 86f0d932e50cce24409b5296ea2be45cad6f317e (patch) | |
| tree | 70a286b05c1307eb517dffd2bb4a980b6d57f389 | |
| parent | 7dae1ce2622198a6b342d6c660b56a68734bf229 (diff) | |
| download | emacs-86f0d932e50cce24409b5296ea2be45cad6f317e.tar.gz emacs-86f0d932e50cce24409b5296ea2be45cad6f317e.zip | |
(undo): Don't loop when encountering empty undo records.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/simple.el | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index acc2703044e..93956a4c258 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2009-03-14 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * simple.el (undo): Don't loop when encountering empty undo records. | ||
| 4 | |||
| 1 | 2009-03-13 Tassilo Horn <tassilo@member.fsf.org> | 5 | 2009-03-13 Tassilo Horn <tassilo@member.fsf.org> |
| 2 | 6 | ||
| 3 | * doc-view.el (doc-view-mode-map): Bind RET to image-next-line. | 7 | * doc-view.el (doc-view-mode-map): Bind RET to image-next-line. |
diff --git a/lisp/simple.el b/lisp/simple.el index 8ffe5912865..d758fc1f0a7 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -1682,9 +1682,13 @@ as an argument limits undo to changes within the current region." | |||
| 1682 | ;; In the ordinary case (not within a region), map the redo | 1682 | ;; In the ordinary case (not within a region), map the redo |
| 1683 | ;; record to the following undos. | 1683 | ;; record to the following undos. |
| 1684 | ;; I don't know how to do that in the undo-in-region case. | 1684 | ;; I don't know how to do that in the undo-in-region case. |
| 1685 | (puthash buffer-undo-list | 1685 | (let ((list buffer-undo-list)) |
| 1686 | (if undo-in-region t pending-undo-list) | 1686 | ;; Strip any leading undo boundaries there might be, like we do |
| 1687 | undo-equiv-table) | 1687 | ;; above when checking. |
| 1688 | (while (eq (car list) nil) | ||
| 1689 | (setq list (cdr list))) | ||
| 1690 | (puthash list (if undo-in-region t pending-undo-list) | ||
| 1691 | undo-equiv-table)) | ||
| 1688 | ;; Don't specify a position in the undo record for the undo command. | 1692 | ;; Don't specify a position in the undo record for the undo command. |
| 1689 | ;; Instead, undoing this should move point to where the change is. | 1693 | ;; Instead, undoing this should move point to where the change is. |
| 1690 | (let ((tail buffer-undo-list) | 1694 | (let ((tail buffer-undo-list) |