Mercurial > emacs
comparison lispref/os.texi @ 72510:b35bf6359ff4
* os.texi (Timers): Avoid waiting inside timers.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Fri, 25 Aug 2006 02:58:08 +0000 |
parents | bacf0e610ccc |
children | ab8fd2fba72d |
comparison
equal
deleted
inserted
replaced
72509:59dd12493697 | 72510:b35bf6359ff4 |
---|---|
1392 contents. When they do, they usually should call @code{undo-boundary} | 1392 contents. When they do, they usually should call @code{undo-boundary} |
1393 both before and after changing the buffer, to separate the timer's | 1393 both before and after changing the buffer, to separate the timer's |
1394 changes from user commands' changes and prevent a single undo entry | 1394 changes from user commands' changes and prevent a single undo entry |
1395 from growing to be quite large. | 1395 from growing to be quite large. |
1396 | 1396 |
1397 Timer functions should also avoid calling functions that cause Emacs | |
1398 to wait, such as @code{sit-for} (@pxref{Waiting}). This can lead to | |
1399 unpredictable effects, since other timers (or even the same timer) can | |
1400 run while waiting. If a timer function needs to perform an action | |
1401 after a certain time has elapsed, it can do this by scheduling a new | |
1402 timer. | |
1403 | |
1397 If a timer function calls functions that can change the match data, | 1404 If a timer function calls functions that can change the match data, |
1398 it should save and restore the match data. @xref{Saving Match Data}. | 1405 it should save and restore the match data. @xref{Saving Match Data}. |
1399 | 1406 |
1400 @deffn Command run-at-time time repeat function &rest args | 1407 @deffn Command run-at-time time repeat function &rest args |
1401 This sets up a timer that calls the function @var{function} with | 1408 This sets up a timer that calls the function @var{function} with |