changeset 6386:1eabdff45c61

(undo): Don't let the undo entries for the undo contain a specific buffer position. Delete it if there is one.
author Richard M. Stallman <rms@gnu.org>
date Wed, 16 Mar 1994 23:41:32 +0000
parents e81e7c424e8a
children b06d5c68be5a
files lisp/simple.el
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Wed Mar 16 23:21:02 1994 +0000
+++ b/lisp/simple.el	Wed Mar 16 23:41:32 1994 +0000
@@ -615,6 +615,16 @@
 	(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.