From fda9748457d804a6e46ebc7054f0976aed516e71 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 25 Aug 2006 02:58:08 +0000 Subject: [PATCH] * os.texi (Timers): Avoid waiting inside timers. --- lispref/ChangeLog | 4 ++++ lispref/os.texi | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 12528d35e55..50c945e3b11 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,7 @@ +2006-08-24 Chong Yidong + + * os.texi (Timers): Avoid waiting inside timers. + 2006-08-21 Lute Kamstra * Makefile.in: Use ../man/texinfo.tex to build elisp.dvi. diff --git a/lispref/os.texi b/lispref/os.texi index d227cf92bcf..b5522dc2a98 100644 --- a/lispref/os.texi +++ b/lispref/os.texi @@ -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}. -- 2.39.2