diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2004-05-18 19:12:15 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2004-05-18 19:12:15 +0000 |
commit | c23670f81e059ebe645c88575f4ddfa67f26bf6b (patch) | |
tree | 71667a6ceaa877ccf3953abedfa7b0fd5f0f5369 /lisp/emacs-lisp/timer.el | |
parent | d9858e4f1889a61b216ae1f99053846362067ccc (diff) | |
parent | a7f7f2540f02834ad128d0c9357a4dbd8222dff4 (diff) | |
download | emacs-c23670f81e059ebe645c88575f4ddfa67f26bf6b.tar.gz emacs-c23670f81e059ebe645c88575f4ddfa67f26bf6b.tar.bz2 emacs-c23670f81e059ebe645c88575f4ddfa67f26bf6b.zip |
Merged in changes from CVS trunk.
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-299
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-300
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-301
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-302
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-303
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-304
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-305
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-306
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-307
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-308
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-309
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-310
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-311
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-312
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-313
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-314
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-315
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-316
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-317
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-318
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-319
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-320
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-321
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-322
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-323
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-324
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-163
Diffstat (limited to 'lisp/emacs-lisp/timer.el')
-rw-r--r-- | lisp/emacs-lisp/timer.el | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index 4ab2ac8e0d4..336a1ff82d0 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el @@ -161,7 +161,7 @@ fire repeatedly that many seconds apart." (aset timer 6 args) timer) -(defun timer-activate (timer) +(defun timer-activate (timer &optional triggered-p) "Put TIMER on the list of active timers." (if (and (timerp timer) (integerp (aref timer 1)) @@ -184,7 +184,7 @@ fire repeatedly that many seconds apart." (if last (setcdr last (cons timer timers)) (setq timer-list (cons timer timers))) - (aset timer 0 nil) + (aset timer 0 triggered-p) (aset timer 7 nil) nil) (error "Invalid or uninitialized timer"))) @@ -270,7 +270,7 @@ This function is called, by name, directly by the C code." (setq timer-event-last timer) (let ((inhibit-quit t)) (if (timerp timer) - (progn + (let (retrigger) ;; Delete from queue. (cancel-timer timer) ;; Re-schedule if requested. @@ -287,13 +287,16 @@ 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 t) + (setq retrigger t))) ;; 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 nil)) + (if retrigger + (aset timer 0 nil))) (error "Bogus timer event")))) ;; This function is incompatible with the one in levents.el. |