]> git.eshelyaron.com Git - emacs.git/commitdiff
(Buffer-menu-revert-function): Clear out undo info before reverting
authorLuc Teirlinck <teirllm@auburn.edu>
Mon, 27 Dec 2004 05:17:09 +0000 (05:17 +0000)
committerLuc Teirlinck <teirllm@auburn.edu>
Mon, 27 Dec 2004 05:17:09 +0000 (05:17 +0000)
and disable undo recording while reverting.

lisp/buff-menu.el

index 1c3fa704041620146596a38c0aa0a3e1e3ef680f..8e1a3e692952ef2bc6d03f77be3bc7c104c9c515 100644 (file)
@@ -198,11 +198,15 @@ Letters do not insert themselves; instead, they are commands.
   (revert-buffer))
 
 (defun Buffer-menu-revert-function (ignore1 ignore2)
+  (or (eq buffer-undo-list t)
+      (setq buffer-undo-list nil))
   ;; We can not use save-excursion here.  The buffer gets erased.
   (let ((ocol (current-column))
        (oline (progn (move-to-column 4)
                      (get-text-property (point) 'buffer)))
-       (prop (point-min)))
+       (prop (point-min))
+       ;; do not make undo records for the reversion.
+       (buffer-undo-list t))
     (list-buffers-noselect Buffer-menu-files-only)
     (while (setq prop (next-single-property-change prop 'buffer))
       (when (eq (get-text-property prop 'buffer) oline)