diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-08-28 01:03:17 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-08-28 01:03:17 +0000 |
commit | 83ff83c08c2a9841677c4dab24b1af5bd034b3e3 (patch) | |
tree | f825d3808552ed28dc0b7aa853cd0a3aad8ed3a7 /lisp/timer.el | |
parent | af56433dc515b465aa87d229252103cf3fdd3a41 (diff) | |
download | emacs-83ff83c08c2a9841677c4dab24b1af5bd034b3e3.tar.gz emacs-83ff83c08c2a9841677c4dab24b1af5bd034b3e3.tar.bz2 emacs-83ff83c08c2a9841677c4dab24b1af5bd034b3e3.zip |
(timer-event-handler): Reactivate timer first,
then run the handler function.
Diffstat (limited to 'lisp/timer.el')
-rw-r--r-- | lisp/timer.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/timer.el b/lisp/timer.el index 68a9e105dae..f60763c2f68 100644 --- a/lisp/timer.el +++ b/lisp/timer.el @@ -264,10 +264,6 @@ This function is called, by name, directly by the C code." (progn ;; Delete from queue. (cancel-timer timer) - ;; Run handler - (condition-case nil - (apply (aref timer 5) (aref timer 6)) - (error nil)) ;; Re-schedule if requested. (if (aref timer 4) (if (aref timer 7) @@ -282,7 +278,13 @@ This function is called, by name, directly by the C code." (aref timer 4)))) (if (> repeats timer-max-repeats) (timer-inc-time timer (* (aref timer 4) repeats))))) - (timer-activate timer)))) + (timer-activate timer))) + ;; Run handler. + ;; We do this after rescheduling so that the handler function + ;; can cancel its own timer successfully with cancel-timer. + (condition-case nil + (apply (aref timer 5) (aref timer 6)) + (error nil))) (error "Bogus timer event")))) ;; This function is incompatible with the one in levents.el. |