[Top][All Lists]

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

Re: Big desktop undo buffer crashes Emacs

From: Luc Teirlinck
Subject: Re: Big desktop undo buffer crashes Emacs
Date: Fri, 12 May 2006 00:13:16 -0500 (CDT)

Bill Wohler wrote:

   Second, I also don't understand the mechanics of undo very well. I was
   under the impression that undo-boundary only grouped a set of changes
   into a single undo entry. As I sit here writing, only a limited amount
   of changes are saved and at some point the oldest undo information will
   be discarded. How is the timer different?

Unlike interactive commands, timers do not automatically create undo
boundaries before and after they run.  We discussed making them do
that automatically, but decided against it.  Thus, if a timer alters
buffer contents, it must add these boundaries itself.  This is what
the excerpt from the Elisp manual I quoted says:

     It is usually a bad idea for timer functions to alter buffer
  contents.  When they do, they usually should call `undo-boundary' both
  before and after changing the buffer, to separate the timer's changes
  from user commands' changes and prevent a single undo entry from
  growing to be quite large.

"Usually" means unless, for instance, undo is disabled in the buffer
anyway when they run.

   > Anyway, my patch, or disabling undo, completely gets rid of this problem.

   So, which one should I apply? Before I fix my timer ;-).

I now believe disabling undo.  But either way, there is no need to fix
your timer, because either way, you are in one of the exceptional
situations where the above quote from the Elisp manual does not apply.



reply via email to

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