Is it something to do with speedbar having idle == yes, or should I
continue to try and parse the itimer-run-expired-timers function.
Thanks for your help so far, at least now I know where its failing.
I think I found it.
It is this code
(if (if (itimer-is-idle itimer)
(or (> (itimer-time-difference recorded-run-time
last-event-time)
0)
(< idle-time (itimer-value itimer)))
recorded-run-time = (0 0 0)
and then the computation in itimer-time-difference overflows an emacs integer.
The attached patch fixes this.
The question now is... How could this ever have worked before?
itimer.el needs to be reworked to use modern interfaces
1999-11-18 Jan Vroonhof <vroonhof(a)math.ethz.ch>
* itimer.el (itimer-run-expired-timers): Don't use save-excursion.
list-itimers rewrites contents!
* lisp/itimer.el (itimer-time-difference): Use
floats always to avoid overflow.
Index: lisp/itimer.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs-20/lisp/itimer.el,v
retrieving revision 1.5
diff -u -u -r1.5 itimer.el
--- itimer.el 1998/05/18 05:42:08 1.5
+++ itimer.el 1999/11/18 18:46:18
@@ -425,43 +425,43 @@
(opoint (point))
(standard-output buf)
(itimers (reverse itimer-list)))
- (set-buffer buf)
- (itimer-edit-mode)
- (setq buffer-read-only nil)
- (erase-buffer)
- (insert
+ (with-current-buffer buf
+ (itimer-edit-mode)
+ (setq buffer-read-only nil)
+ (erase-buffer)
+ (insert
"Name Value Restart Function Idle Arguments"
"\n"
"---- ----- ------- -------- ---- --------")
- (if (null itimer-edit-start-marker)
- (setq itimer-edit-start-marker (point)))
- (while itimers
- (newline 1)
- (prin1 (itimer-name (car itimers)))
- (tab-to-tab-stop)
- (insert (itimer-truncate-string
- (format "%5.5s" (itimer-value (car itimers))) 5))
- (tab-to-tab-stop)
- (insert (itimer-truncate-string
- (format "%5.5s" (itimer-restart (car itimers))) 5))
- (tab-to-tab-stop)
- (insert (itimer-truncate-string
+ (if (null itimer-edit-start-marker)
+ (setq itimer-edit-start-marker (point)))
+ (while itimers
+ (newline 1)
+ (prin1 (itimer-name (car itimers)))
+ (tab-to-tab-stop)
+ (insert (itimer-truncate-string
+ (format "%5.5s" (itimer-value (car itimers))) 5))
+ (tab-to-tab-stop)
+ (insert (itimer-truncate-string
+ (format "%5.5s" (itimer-restart (car itimers))) 5))
+ (tab-to-tab-stop)
+ (insert (itimer-truncate-string
(format "%.19s" (itimer-function (car itimers))) 19))
- (tab-to-tab-stop)
- (if (itimer-is-idle (car itimers))
- (insert "yes")
- (insert "no"))
- (tab-to-tab-stop)
- (if (itimer-uses-arguments (car itimers))
- (prin1 (itimer-function-arguments (car itimers)))
- (prin1 'NONE))
- (setq itimers (cdr itimers)))
- ;; restore point
- (goto-char opoint)
- (if (< (point) itimer-edit-start-marker)
+ (tab-to-tab-stop)
+ (if (itimer-is-idle (car itimers))
+ (insert "yes")
+ (insert "no"))
+ (tab-to-tab-stop)
+ (if (itimer-uses-arguments (car itimers))
+ (prin1 (itimer-function-arguments (car itimers)))
+ (prin1 'NONE))
+ (setq itimers (cdr itimers)))
+ ;; restore point
+ (goto-char opoint)
+ (if (< (point) itimer-edit-start-marker)
(goto-char itimer-edit-start-marker))
- (setq buffer-read-only t)
- (display-buffer buf)))
+ (setq buffer-read-only t)
+ (display-buffer buf))))
(defun edit-itimers ()
"Display a list of all itimers and select it for editing.
@@ -693,7 +693,7 @@
(if (if (itimer-is-idle itimer)
(or (> (itimer-time-difference recorded-run-time
last-event-time)
- 0)
+ 0)
(< idle-time (itimer-value itimer)))
(> (itimer-value itimer) 0))
(setq next-wakeup
@@ -741,8 +741,7 @@
;; if user is viewing the timer list, update displayed info.
(let ((b (get-buffer "*Itimer List*")))
(if (and b (get-buffer-window b))
- (save-excursion
- (list-itimers))))
+ (list-itimers)))
next-wakeup ))
(defun itimer-process-filter (process string)
@@ -840,7 +839,8 @@
(setq 65536-secs (- (nth 0 t1) (nth 0 t2) carry))
;; loses for interval larger than the maximum signed Lisp integer.
;; can't really be helped.
- (+ (* 65536-secs 65536)
+ ;; JV So we use floats always.
+ (+ (* 65536-secs 65536.0)
secs
(/ usecs (if (featurep 'lisp-float-type) 1e6 1000000)))))