> Interpreting this is milliseconds, it follows that after 74 hours, 33
> minutes and 55 seconds I will start getting the error :(

Hmm.. the code needs the integer to wrap-around, but truncate refuses to
do that.

Does the patch below work?


        Stefan


--- xt-mouse.el 16 mai 2007 11:59:29 -0400      1.40
+++ xt-mouse.el 24 mai 2007 12:50:14 -0400      
@@ -126,6 +126,14 @@
         (+ c #x8000000 128)
       c)))
 
+(defun xterm-mouse-truncate (f)
+  "Truncate with wrap-around."
+  ;; We assume there's no more than 1000000 wraparounds.
+  (let* ((maxwrap 1000000)
+         (dbig (truncate (/ f maxwrap)))
+         (fdiff (- f (* 1.0 maxwrap dbig))))
+    (+ (truncate fdiff) (* maxwrap dbig))))
+
 (defun xterm-mouse-event ()
   "Convert XTerm mouse event to Emacs mouse event."
   (let* ((type (- (xterm-mouse-event-read) #o40))
@@ -133,7 +141,7 @@
         (y (- (xterm-mouse-event-read) #o40 1))
         ;; Emulate timestamp information.  This is accurate enough
         ;; for default value of mouse-1-click-follows-link (450msec).
-        (timestamp (truncate
+        (timestamp (xterm-mouse-truncate
                     (* 1000
                        (- (float-time)
                           (or xt-mouse-epoch


_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Reply via email to