emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: undo in loaddefs.el buffer


From: Luc Teirlinck
Subject: Re: undo in loaddefs.el buffer
Date: Wed, 29 Dec 2004 23:06:57 -0600 (CST)

I believe that Auto Revert Tail mode needs two undo boundaries.  I
checked that without them it keeps accumulating one big undo entry.
The patch below does puts in the undo boundaries.  I can install if
desired.

I do not believe that Auto Revert Mode itself needs any undo
boundaries.  All currently reverted buffers now clear out all undo
info as a part of reverting, so the problem is handled by the revert
functions.

The problem with Auto Revert Tail mode is that it does not use a
"real" revert.

I do not know whether there are any circumstances where timers that do
fontification could accumulate big single undo entries.

Here is the autorevert patch:

===File ~/autorevert-diff===================================
*** autorevert.el       29 Dec 2004 20:37:00 -0600      1.41
--- autorevert.el       29 Dec 2004 21:08:55 -0600      
***************
*** 444,454 ****
--- 444,456 ----
        (file buffer-file-name)
        buffer-file-name)               ; ignore that file has changed
      (when (> size auto-revert-tail-pos)
+       (undo-boundary)
        (save-restriction
        (widen)
        (save-excursion
          (goto-char (point-max))
          (insert-file-contents file nil auto-revert-tail-pos size)))
+       (undo-boundary)
        (setq auto-revert-tail-pos size)
        (set-buffer-modified-p modified)))
    (set-visited-file-modtime))
============================================================




reply via email to

[Prev in Thread] Current Thread [Next in Thread]