135 |
(aset timer 3 (or (nth 2 time) 0)))) |
(aset timer 3 (or (nth 2 time) 0)))) |
136 |
|
|
137 |
(defun timer-set-time-with-usecs (timer time usecs &optional delta) |
(defun timer-set-time-with-usecs (timer time usecs &optional delta) |
138 |
"Set the trigger time of TIMER to TIME. |
"Set the trigger time of TIMER to TIME plus USECS. |
139 |
TIME must be in the internal format returned by, e.g., `current-time'. |
TIME must be in the internal format returned by, e.g., `current-time'. |
140 |
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. |
141 |
|
If optional fourth argument DELTA is a non-zero integer, make the timer |
142 |
fire repeatedly that many seconds apart." |
fire repeatedly that many seconds apart." |
143 |
(or (timerp timer) |
(or (timerp timer) |
144 |
(error "Invalid timer")) |
(error "Invalid timer")) |
145 |
(aset timer 1 (car time)) |
(aset timer 1 (nth 0 time)) |
146 |
(aset timer 2 (if (consp (cdr time)) (car (cdr time)) (cdr time))) |
(aset timer 2 (nth 1 time)) |
147 |
(aset timer 3 usecs) |
(aset timer 3 usecs) |
148 |
(aset timer 4 (and (numberp delta) (> delta 0) delta)) |
(aset timer 4 (and (numberp delta) (> delta 0) delta)) |
149 |
timer) |
timer) |