From 2512c9f0f0e6cc71c601ffdb0690b9cf5642734b Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 16 Mar 1994 23:41:32 +0000 Subject: [PATCH] (undo): Don't let the undo entries for the undo contain a specific buffer position. Delete it if there is one. --- lisp/simple.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lisp/simple.el b/lisp/simple.el index 66f0003bf4d..cc2e4c6d801 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -615,6 +615,16 @@ A numeric argument serves as a repeat count." (progn (undo-start) (undo-more 1))) (undo-more (or arg 1)) + ;; 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)))) (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. -- 2.39.5