]> code.delx.au - gnu-emacs/commitdiff
* os.texi (Timers): Avoid waiting inside timers.
authorChong Yidong <cyd@stupidchicken.com>
Fri, 25 Aug 2006 02:58:08 +0000 (02:58 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Fri, 25 Aug 2006 02:58:08 +0000 (02:58 +0000)
lispref/ChangeLog
lispref/os.texi

index 12528d35e557fe945c78f669f131919e0b147ecd..50c945e3b118221aad442160038590d8a27484e0 100644 (file)
@@ -1,3 +1,7 @@
+2006-08-24  Chong Yidong  <cyd@stupidchicken.com>
+
+       * os.texi (Timers): Avoid waiting inside timers.
+
 2006-08-21  Lute Kamstra  <lute@gnu.org>
 
        * Makefile.in: Use ../man/texinfo.tex to build elisp.dvi.
index d227cf92bcfd678be40422a537d931df51d3f1c8..b5522dc2a98f6a1f043b3253c5828bb87724bc3c 100644 (file)
@@ -1394,6 +1394,13 @@ 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.
 
+  Timer functions should also avoid calling functions that cause Emacs
+to wait, such as @code{sit-for} (@pxref{Waiting}).  This can lead to
+unpredictable effects, since other timers (or even the same timer) can
+run while waiting.  If a timer function needs to perform an action
+after a certain time has elapsed, it can do this by scheduling a new
+timer.
+
   If a timer function calls functions that can change the match data,
 it should save and restore the match data.  @xref{Saving Match Data}.