aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1996-01-29 02:26:52 +0000
committerRichard M. Stallman1996-01-29 02:26:52 +0000
commit8a9fe4d22b9108dbb75a08989f8c735ef73d4b37 (patch)
tree783be8ae448eb0ceef08de1d653621fcfce138df /lisp
parent4395bfdb6aa56010c9922ae71ec18ff485c647bf (diff)
downloademacs-8a9fe4d22b9108dbb75a08989f8c735ef73d4b37.tar.gz
emacs-8a9fe4d22b9108dbb75a08989f8c735ef73d4b37.zip
(run-after-delay): Add autoload cookie.
Delete USECS arg. Let REPEAT be a float.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/timer.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/timer.el b/lisp/timer.el
index 406c8ba8f41..3b468023437 100644
--- a/lisp/timer.el
+++ b/lisp/timer.el
@@ -200,19 +200,21 @@ the call to the function. If REPEAT is nil or 0, call it just once."
200 (timer-set-function timer function args) 200 (timer-set-function timer function args)
201 (timer-activate timer))) 201 (timer-activate timer)))
202 202
203(defun run-after-delay (secs usecs repeat function &rest args) 203;;;###autoload
204 "Perform an action after a delay of SECS seconds and USECS microseconds. 204(defun run-after-delay (secs repeat function &rest args)
205 "Perform an action after a delay of SECS seconds.
205Repeat the action every REPEAT seconds, if REPEAT is non-nil. 206Repeat the action every REPEAT seconds, if REPEAT is non-nil.
207SECS and REPEAT need not be integers.
206The action is to call FUNCTION with arguments ARGS." 208The action is to call FUNCTION with arguments ARGS."
207 (interactive "sRun after delay (seconds): \nNRepeat interval: \naFunction: ") 209 (interactive "sRun after delay (seconds): \nNRepeat interval: \naFunction: ")
208 210
209 (or (null repeat) 211 (or (null repeat)
210 (natnump repeat) 212 (and (numberp repeat) (>= repeat 0))
211 (error "Invalid repetition interval")) 213 (error "Invalid repetition interval"))
212 214
213 (let ((timer (timer-create))) 215 (let ((timer (timer-create)))
214 (timer-set-time timer (current-time)) 216 (timer-set-time timer (current-time))
215 (timer-inc-time timer secs usecs) 217 (timer-inc-time timer secs)
216 (timer-set-function timer function args) 218 (timer-set-function timer function args)
217 (timer-activate timer))) 219 (timer-activate timer)))
218 220