aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/simple.el
diff options
context:
space:
mode:
authorGerd Moellmann2001-09-06 08:49:34 +0000
committerGerd Moellmann2001-09-06 08:49:34 +0000
commit003550c5e3239fc7a09c1ef4d397fc985a94a7aa (patch)
treea6665d0226df2c928e98d68fed5d2805ddc1524e /lisp/simple.el
parent05b2448700a7c0f54761c2c54387fd05a439d86d (diff)
downloademacs-003550c5e3239fc7a09c1ef4d397fc985a94a7aa.tar.gz
emacs-003550c5e3239fc7a09c1ef4d397fc985a94a7aa.zip
(undo): Remove positions from buffer-undo-list up to
the next undo boundary only.
Diffstat (limited to 'lisp/simple.el')
-rw-r--r--lisp/simple.el25
1 files changed, 18 insertions, 7 deletions
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.