# HG changeset patch # User Chong Yidong # Date 1156474688 0 # Node ID b35bf6359ff43cde3a7865bdc1f0161a2a2055ba # Parent 59dd1249369705770eb67532c5ea9b6a80129c9e * os.texi (Timers): Avoid waiting inside timers. diff -r 59dd12493697 -r b35bf6359ff4 lispref/ChangeLog --- a/lispref/ChangeLog Fri Aug 25 02:15:02 2006 +0000 +++ b/lispref/ChangeLog Fri Aug 25 02:58:08 2006 +0000 @@ -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 -r 59dd12493697 -r b35bf6359ff4 lispref/os.texi --- a/lispref/os.texi Fri Aug 25 02:15:02 2006 +0000 +++ b/lispref/os.texi Fri Aug 25 02:58:08 2006 +0000 @@ -1394,6 +1394,13 @@ 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}.