[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mouse-1-click-follows-link with xt-mouse (was: with t-mouse)

From: Kim F. Storm
Subject: Re: mouse-1-click-follows-link with xt-mouse (was: with t-mouse)
Date: Wed, 21 Mar 2007 11:07:37 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.96 (gnu/linux)

Nick Roberts <address@hidden> writes:

> Actually the patch below seems to work for xt-mouse.el.  The timestamp isn't
> computed directly from the mouse click, but for a value of many (450)
> milliseconds it seems good enough.
> Shall I install it?

It is ok with me, but you should add suitable comments
to say that you emulate the time-stamp information, and
the possible implications of this.

Also, there is a problem with timestamp wrap-around
every 2^16 seconds.

I think this approach is safer:

Instead of:

> +      (time (current-time))
> +      (timestamp (+ ( * (nth 1 time) 1000 ) (/ (nth 2 time) 1000)))

use relative time:

(defvar xt-mouse-epoch nil)


  (timestamp (truncate
              (* 1000
                 (- (float-time)
                    (or xt-mouse-epoch
                        (setq xt-mouse-epoch (float-time)))))))

Kim F. Storm <address@hidden> http://www.cua.dk

reply via email to

[Prev in Thread] Current Thread [Next in Thread]