diff lisp/itimer.el @ 371:cc15677e0335 r21-2b1

Import from CVS: tag r21-2b1
author cvs
date Mon, 13 Aug 2007 11:03:08 +0200
parents 8e84bee8ddd0
children 8626e4521993
line wrap: on
line diff
--- a/lisp/itimer.el	Mon Aug 13 11:01:58 2007 +0200
+++ b/lisp/itimer.el	Mon Aug 13 11:03:08 2007 +0200
@@ -20,8 +20,6 @@
 
 (provide 'itimer)
 
-(require 'lisp-float-type)
-
 ;; `itimer' feature means Emacs-Lisp programmers get:
 ;;    itimerp
 ;;    itimer-live-p
@@ -48,7 +46,7 @@
 ;;
 ;; See the doc strings of these functions for more information.
 
-(defvar itimer-version "1.09"
+(defvar itimer-version "1.07"
   "Version number of the itimer package.")
 
 (defvar itimer-list nil
@@ -64,7 +62,7 @@
 (defvar itimer-timer-last-wakeup nil
   "The time the timer driver function last ran.")
 
-(defvar itimer-short-interval 1e-3
+(defvar itimer-short-interval (if (featurep 'lisp-float-type) 1e-3 1)
   "Interval used for scheduling an event a very short time in the future.
 Used internally to make the scheduler wake up early.
 Unit is seconds.")
@@ -673,7 +671,7 @@
 	(inhibit-quit t))
     (setq next-wakeup 600)
     (cond ((and (boundp 'last-command-event-time)
-		(consp last-command-event-time))
+		(consp 'last-command-event-time))
 	   (setq last-event-time last-command-event-time
 		 idle-time (itimer-time-difference (current-time)
 						   last-event-time)))
@@ -840,9 +838,11 @@
 	       secs (+ secs 65536))
       (setq carry 0))
     (setq 65536-secs (- (nth 0 t1) (nth 0 t2) carry))
-    (+ (* 65536-secs 65536.0)
+    ;; loses for interval larger than the maximum signed Lisp integer.
+    ;; can't really be helped.
+    (+ (* 65536-secs 65536)
        secs
-       (/ usecs 1000000.0))))
+       (/ usecs (if (featurep 'lisp-float-type) 1e6 1000000)))))
 
 (defun itimer-timer-driver (&rest ignored)
   ;; inhibit quit because if the user quits at an inopportune