Hi,
I read itimer.el thoroughly and made a patch fixing the bug on
which start-itimer does not work as the value specified by the
first argument TIME when other timers are running. This bug is
brought about because the difference of the present time and the
time when the itimer driver was woken up will be subtracted from
the specified value TIME. I solved it by adding the difference
to TIME beforehand. It is helpful to run-at-time as well.
Don't forget to load itimer.elc when you test it. :)
2003-12-12 Katsumi Yamaoka <yamaoka(a)jpl.org>
* itimer.el (activate-itimer): Modify the itimer timeout value as
if it were begun at the last time when the itimer driver was woken
up.
--- itimer.el~ 2001-04-12 18:21:28 +0000
+++ itimer.el 2003-12-12 00:43:13 +0000
@@ -406,6 +406,14 @@
(error "itimer named \"%s\" already existing and activated"
(itimer-name itimer))))
(let ((inhibit-quit t))
+ (if itimer-timer
+ ;; Modify the itimer timeout value as if it were begun
+ ;; at the last time when the itimer driver was woken up.
+ (set-itimer-value
+ itimer
+ (+ (itimer-value itimer)
+ (itimer-time-difference (current-time)
+ itimer-timer-last-wakeup))))
;; add the itimer to the global list
(setq itimer-list (cons itimer itimer-list))
;; If the itimer process is scheduled to wake up too late for