aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2006-09-21 01:51:55 +0000
committerRichard M. Stallman2006-09-21 01:51:55 +0000
commit79d41bd07d5d573895b793d3a4e9c2d1bd921c62 (patch)
tree4c36fa19e931fb6cd6ce7afaaf788bc3ef8780e3
parent8584826b5b44793787434699e48a5fa271ebe704 (diff)
downloademacs-79d41bd07d5d573895b793d3a4e9c2d1bd921c62.tar.gz
emacs-79d41bd07d5d573895b793d3a4e9c2d1bd921c62.zip
(Timers): Clarify about REPEAT when timer is delayed.
-rw-r--r--lispref/os.texi17
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
1408This sets up a timer that calls the function @var{function} with 1408This sets up a timer that calls the function @var{function} with
1409arguments @var{args} at time @var{time}. If @var{repeat} is a number 1409arguments @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
1411seconds after that. If @var{repeat} is @code{nil}, the timer runs 1411@var{repeat} seconds after @var{time}. If @var{repeat} is @code{nil},
1412only once. 1412the 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,
1462but remember that any invocation of a timer can be late. Lateness of
1463one repetition has no effect on the scheduled time of the next
1464repetition. For instance, if Emacs is busy computing for long enough
1465to cover three scheduled repetitions of the timer, and then starts to
1466wait, it will immediately call the timer function three times in
1467immediate succession (presuming no other timers trigger before or
1468between them). If you want a timer to run again no less than @var{n}
1469seconds after the last invocation, don't use the @var{repeat} argument.
1470Instead, 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{}
1462Execute @var{body}, but give up after @var{seconds} seconds. If 1473Execute @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