diff options
| author | Gerd Moellmann | 2001-09-06 08:49:34 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-09-06 08:49:34 +0000 |
| commit | 003550c5e3239fc7a09c1ef4d397fc985a94a7aa (patch) | |
| tree | a6665d0226df2c928e98d68fed5d2805ddc1524e | |
| parent | 05b2448700a7c0f54761c2c54387fd05a439d86d (diff) | |
| download | emacs-003550c5e3239fc7a09c1ef4d397fc985a94a7aa.tar.gz emacs-003550c5e3239fc7a09c1ef4d397fc985a94a7aa.zip | |
(undo): Remove positions from buffer-undo-list up to
the next undo boundary only.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/simple.el | 25 |
2 files changed, 23 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c769848d773..3a82065ceb5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2001-09-06 Gerd Moellmann <gerd@gnu.org> | ||
| 2 | |||
| 3 | * simple.el (undo): Remove positions from buffer-undo-list up to | ||
| 4 | the next undo boundary only. | ||
| 5 | |||
| 1 | 2001-09-06 Eli Zaretskii <eliz@is.elta.co.il> | 6 | 2001-09-06 Eli Zaretskii <eliz@is.elta.co.il> |
| 2 | 7 | ||
| 3 | * makefile.nt (install): Don't copy sc.el. Reported by Richard | 8 | * makefile.nt (install): Don't copy sc.el. Reported by Richard |
diff --git a/lisp/simple.el b/lisp/simple.el index 8d2a5707898..e276b1dea32 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -961,13 +961,24 @@ as an argument limits undo to changes within the current region." | |||
| 961 | ;; Don't specify a position in the undo record for the undo command. | 961 | ;; Don't specify a position in the undo record for the undo command. |
| 962 | ;; Instead, undoing this should move point to where the change is. | 962 | ;; Instead, undoing this should move point to where the change is. |
| 963 | (let ((tail buffer-undo-list) | 963 | (let ((tail buffer-undo-list) |
| 964 | done) | 964 | (prev nil)) |
| 965 | (while (and tail (not done) (not (null (car tail)))) | 965 | (while (car tail) |
| 966 | (if (integerp (car tail)) | 966 | (when (integerp (car tail)) |
| 967 | (progn | 967 | (let ((pos (car tail))) |
| 968 | (setq done t) | 968 | (if (null prev) |
| 969 | (setq buffer-undo-list (delq (car tail) buffer-undo-list)))) | 969 | (setq buffer-undo-list (cdr tail)) |
| 970 | (setq tail (cdr tail)))) | 970 | (setcdr prev (cdr tail))) |
| 971 | (setq tail (cdr tail)) | ||
| 972 | (while (car tail) | ||
| 973 | (if (eq pos (car tail)) | ||
| 974 | (if prev | ||
| 975 | (setcdr prev (cdr tail)) | ||
| 976 | (setq buffer-undo-list (cdr tail))) | ||
| 977 | (setq prev tail)) | ||
| 978 | (setq tail (cdr tail))) | ||
| 979 | (setq tail nil))) | ||
| 980 | (setq prev tail tail (cdr tail)))) | ||
| 981 | |||
| 971 | (and modified (not (buffer-modified-p)) | 982 | (and modified (not (buffer-modified-p)) |
| 972 | (delete-auto-save-file-if-necessary recent-save))) | 983 | (delete-auto-save-file-if-necessary recent-save))) |
| 973 | ;; If we do get all the way thru, make this-command indicate that. | 984 | ;; If we do get all the way thru, make this-command indicate that. |