From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: mouse-1-click-follows-link with xt-mouse (was: with t-mouse) Date: Wed, 21 Mar 2007 11:07:37 +0100 Message-ID: References: <87mz2tqhhn.fsf@pacem.orebokech.com> <878xeayadw.fsf@pacem.orebokech.com> <87649eaqti.fsf@wigwam.brockman.se> <877itezkg9.fsf@stupidchicken.com> <17918.26352.744588.929984@kahikatea.snap.net.nz> <17918.28984.190415.507648@kahikatea.snap.net.nz> <17919.4822.767974.760203@kahikatea.snap.net.nz> <17920.33032.840044.978947@kahikatea.snap.net.nz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1174471692 17531 80.91.229.12 (21 Mar 2007 10:08:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 21 Mar 2007 10:08:12 +0000 (UTC) Cc: cyd@stupidchicken.com, emacs-devel@gnu.org, rms@gnu.org, bojohan+news@dd.chalmers.se To: Nick Roberts Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 21 11:08:05 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HTxjf-0002hf-S6 for ged-emacs-devel@m.gmane.org; Wed, 21 Mar 2007 11:08:04 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HTxlK-0006YT-Kz for ged-emacs-devel@m.gmane.org; Wed, 21 Mar 2007 05:09:46 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HTxlF-0006Nz-Em for emacs-devel@gnu.org; Wed, 21 Mar 2007 06:09:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HTxlE-0006Gy-CT for emacs-devel@gnu.org; Wed, 21 Mar 2007 06:09:40 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HTxlE-0006GL-3n for emacs-devel@gnu.org; Wed, 21 Mar 2007 05:09:40 -0500 Original-Received: from pfepa.post.tele.dk ([195.41.46.235]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HTxjX-0004PK-Dn; Wed, 21 Mar 2007 06:07:55 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (unknown [80.165.4.124]) by pfepa.post.tele.dk (Postfix) with SMTP id D45A5FAC04E; Wed, 21 Mar 2007 11:07:42 +0100 (CET) In-Reply-To: <17920.33032.840044.978947@kahikatea.snap.net.nz> (Nick Roberts's message of "Wed\, 21 Mar 2007 12\:49\:12 +1200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.96 (gnu/linux) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:68207 Archived-At: Nick Roberts 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 http://www.cua.dk