(undo): Remove positions from buffer-undo-list up to
the next undo boundary only.
This commit is contained in:
parent
05b2448700
commit
003550c5e3
2 changed files with 23 additions and 7 deletions
|
@ -1,3 +1,8 @@
|
|||
2001-09-06 Gerd Moellmann <gerd@gnu.org>
|
||||
|
||||
* simple.el (undo): Remove positions from buffer-undo-list up to
|
||||
the next undo boundary only.
|
||||
|
||||
2001-09-06 Eli Zaretskii <eliz@is.elta.co.il>
|
||||
|
||||
* makefile.nt (install): Don't copy sc.el. Reported by Richard
|
||||
|
|
|
@ -961,13 +961,24 @@ as an argument limits undo to changes within the current region."
|
|||
;; 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)
|
||||
done)
|
||||
(while (and tail (not done) (not (null (car tail))))
|
||||
(if (integerp (car tail))
|
||||
(progn
|
||||
(setq done t)
|
||||
(setq buffer-undo-list (delq (car tail) buffer-undo-list))))
|
||||
(setq tail (cdr tail))))
|
||||
(prev nil))
|
||||
(while (car tail)
|
||||
(when (integerp (car tail))
|
||||
(let ((pos (car tail)))
|
||||
(if (null prev)
|
||||
(setq buffer-undo-list (cdr tail))
|
||||
(setcdr prev (cdr tail)))
|
||||
(setq tail (cdr tail))
|
||||
(while (car tail)
|
||||
(if (eq pos (car tail))
|
||||
(if prev
|
||||
(setcdr prev (cdr tail))
|
||||
(setq buffer-undo-list (cdr tail)))
|
||||
(setq prev tail))
|
||||
(setq tail (cdr tail)))
|
||||
(setq tail nil)))
|
||||
(setq prev tail tail (cdr tail))))
|
||||
|
||||
(and modified (not (buffer-modified-p))
|
||||
(delete-auto-save-file-if-necessary recent-save)))
|
||||
;; If we do get all the way thru, make this-command indicate that.
|
||||
|
|
Loading…
Add table
Reference in a new issue