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: Sun, 26 Dec 2004 23:29:33 -0600 (CST)

Richard Stallman wrote:

       Moreover, in addition to those two and texinfo-format-buffer and
       loaddefs.el, there is a problem when you autorevert the Buffer Menu.
       At regular intervals, you get asked the "undo" question, even when the
       Buffer Menu is very tiny (like three buffers).

   That suggests something is making too much undo info.  It would be
   good to debug why it makes so much undo info.  Forcing Emacs into the
   debugger when it is asking the question would be a way to do that.  Or
   stopping Emacs with GDB.

Each time the Buffer Menu reverted (every five seconds), it added more
undo info to the same undo entry without even making an undo boundary.
The patch for the Buffer Menu (clearing out the undo info when
reverting), which I installed, fixes that problem, so it should be
gone now.

       3.  Fail to put in undo boundaries, thus accumulating one huge single
           undo entry, eventually triggering the undo-outer-limit question.

       Situation 3 seems to happen rather easily with timers.

   Maybe that means Emacs should put in undo boundaries at the
   beginning and end of a timer.

Most timers do not modify the buffer.  But, _maybe_ that is OK.  From
reading the code of Fundo_boundary, it appears that it will never make
consecutive redundant boundaries anyway.  

Timers can switch buffers.  Auto Revert does.  Again, _maybe_ that is
OK because (from `(elisp)Undo'):

All buffer modifications add a boundary whenever the previous
undoable change was made in some other buffer.  This is to ensure
that each command makes a boundary in each buffer where it makes
changes.

       Although the problem with the buffer menu appears to be caused by (3)
       I believe that the reasons for discarding undo info when reverting a
       file, also apply to reverting the Buffer Menu.  So the patch below,
       discards all undo info when reverting the Buffer Menu.

   I think that is right, and likewise for Dired.

At closer look, Dired already does discard all undo Info when
reverting, in dired-readin.

Sincerely,

Luc.




reply via email to

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