update.
[chise/xemacs-chise.git.1] / lisp / itimer.el
index 5199917..6c2d793 100644 (file)
@@ -167,7 +167,7 @@ This is a macro."
 (defun itimer-live-p (object)
   "Return non-nil if OBJECT is an itimer and is active.
 ``Active'' means Emacs will run it when it expires.
-`activate-timer' must be called on an itimer to make it active.
+`activate-itimer' must be called on an itimer to make it active.
 Itimers started with `start-itimer' are automatically active."
   (and (itimerp object) (memq object itimer-list)))
 
@@ -406,6 +406,14 @@ its FUNCTION will be called when it expires, and so on."
        (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