diff options
| author | Richard M. Stallman | 2006-09-21 01:51:55 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2006-09-21 01:51:55 +0000 |
| commit | 79d41bd07d5d573895b793d3a4e9c2d1bd921c62 (patch) | |
| tree | 4c36fa19e931fb6cd6ce7afaaf788bc3ef8780e3 | |
| parent | 8584826b5b44793787434699e48a5fa271ebe704 (diff) | |
| download | emacs-79d41bd07d5d573895b793d3a4e9c2d1bd921c62.tar.gz emacs-79d41bd07d5d573895b793d3a4e9c2d1bd921c62.zip | |
(Timers): Clarify about REPEAT when timer is delayed.
| -rw-r--r-- | lispref/os.texi | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lispref/os.texi b/lispref/os.texi index edf5833bf42..6c2d660709e 100644 --- a/lispref/os.texi +++ b/lispref/os.texi | |||
| @@ -1407,9 +1407,9 @@ it should save and restore the match data. @xref{Saving Match Data}. | |||
| 1407 | @deffn Command run-at-time time repeat function &rest args | 1407 | @deffn Command run-at-time time repeat function &rest args |
| 1408 | 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 |
| 1409 | arguments @var{args} at time @var{time}. If @var{repeat} is a number | 1409 | arguments @var{args} at time @var{time}. If @var{repeat} is a number |
| 1410 | (integer or floating point), the timer also runs every @var{repeat} | 1410 | (integer or floating point), the timer is scheduled to run again every |
| 1411 | seconds after that. If @var{repeat} is @code{nil}, the timer runs | 1411 | @var{repeat} seconds after @var{time}. If @var{repeat} is @code{nil}, |
| 1412 | only once. | 1412 | the timer runs only once. |
| 1413 | 1413 | ||
| 1414 | @var{time} may specify an absolute or a relative time. | 1414 | @var{time} may specify an absolute or a relative time. |
| 1415 | 1415 | ||
| @@ -1458,6 +1458,17 @@ the particular scheduled future action. You can use this value to call | |||
| 1458 | @code{cancel-timer} (see below). | 1458 | @code{cancel-timer} (see below). |
| 1459 | @end deffn | 1459 | @end deffn |
| 1460 | 1460 | ||
| 1461 | A repeating timer nominally ought to run every @var{repeat} seconds, | ||
| 1462 | but remember that any invocation of a timer can be late. Lateness of | ||
| 1463 | one repetition has no effect on the scheduled time of the next | ||
| 1464 | repetition. For instance, if Emacs is busy computing for long enough | ||
| 1465 | to cover three scheduled repetitions of the timer, and then starts to | ||
| 1466 | wait, it will immediately call the timer function three times in | ||
| 1467 | immediate succession (presuming no other timers trigger before or | ||
| 1468 | between them). If you want a timer to run again no less than @var{n} | ||
| 1469 | seconds after the last invocation, don't use the @var{repeat} argument. | ||
| 1470 | Instead, the timer function should explicitly reschedule the timer. | ||
| 1471 | |||
| 1461 | @defmac with-timeout (seconds timeout-forms@dots{}) body@dots{} | 1472 | @defmac with-timeout (seconds timeout-forms@dots{}) body@dots{} |
| 1462 | Execute @var{body}, but give up after @var{seconds} seconds. If | 1473 | Execute @var{body}, but give up after @var{seconds} seconds. If |
| 1463 | @var{body} finishes before the time is up, @code{with-timeout} returns | 1474 | @var{body} finishes before the time is up, @code{with-timeout} returns |