summaryrefslogtreecommitdiff
path: root/lisp/timer.el
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2002-07-12 11:56:42 +0000
committerJuanma Barranquero <lekktu@gmail.com>2002-07-12 11:56:42 +0000
commit120034b30905a743746f8de9ebc59036c4c5d92e (patch)
treed328a66e143f6b5b66fd4249ee77a5f4531d41d5 /lisp/timer.el
parenta8fda945006c87d82f6a1acdaf259eb43f7f375f (diff)
downloademacs-120034b30905a743746f8de9ebc59036c4c5d92e.tar.gz
(timer-set-time-with-usecs): Fix documentation. Simplify extraction of time data.
Diffstat (limited to 'lisp/timer.el')
-rw-r--r--lisp/timer.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/timer.el b/lisp/timer.el
index 0c159c6023d..c98d160d57f 100644
--- a/lisp/timer.el
+++ b/lisp/timer.el
@@ -137,14 +137,15 @@ SECS may be a fraction."
(aset timer 3 (or (nth 2 time) 0))))
(defun timer-set-time-with-usecs (timer time usecs &optional delta)
- "Set the trigger time of TIMER to TIME.
+ "Set the trigger time of TIMER to TIME plus USECS.
TIME must be in the internal format returned by, e.g., `current-time'.
-If optional third argument DELTA is a non-zero integer, make the timer
+The microsecond count from TIME is ignored, and USECS is used instead.
+If optional fourth argument DELTA is a non-zero integer, make the timer
fire repeatedly that many seconds apart."
(or (timerp timer)
(error "Invalid timer"))
- (aset timer 1 (car time))
- (aset timer 2 (if (consp (cdr time)) (car (cdr time)) (cdr time)))
+ (aset timer 1 (nth 0 time))
+ (aset timer 2 (nth 1 time))
(aset timer 3 usecs)
(aset timer 4 (and (numberp delta) (> delta 0) delta))
timer)