changeset 46319:534629ca4cc4

(timer-set-time-with-usecs): Fix documentation. Simplify extraction of time data.
author Juanma Barranquero <lekktu@gmail.com>
date Fri, 12 Jul 2002 11:56:30 +0000
parents e3f0fe8c555a
children 85556f404121
files lisp/timer.el
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/timer.el	Fri Jul 12 11:19:24 2002 +0000
+++ b/lisp/timer.el	Fri Jul 12 11:56:30 2002 +0000
@@ -137,14 +137,15 @@
     (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)