From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Difficulty with mouse-1-click-follows-link Date: Sun, 09 Oct 2005 13:57:59 -0400 Message-ID: <877jcmlgig.fsf@stupidchicken.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1128880710 4740 80.91.229.2 (9 Oct 2005 17:58:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 9 Oct 2005 17:58:30 +0000 (UTC) Cc: "Kim F.Storm" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 09 19:58:20 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EOfR3-0007WP-4k for ged-emacs-devel@m.gmane.org; Sun, 09 Oct 2005 19:58:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EOfR2-0001ZX-ME for ged-emacs-devel@m.gmane.org; Sun, 09 Oct 2005 13:58:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EOfQn-0001ZG-Lg for emacs-devel@gnu.org; Sun, 09 Oct 2005 13:57:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EOfQl-0001Yp-Vk for emacs-devel@gnu.org; Sun, 09 Oct 2005 13:57:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EOfQl-0001Yi-Ja for emacs-devel@gnu.org; Sun, 09 Oct 2005 13:57:51 -0400 Original-Received: from [18.95.6.216] (helo=localhost.localdomain) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EOfQl-0005jf-UY for emacs-devel@gnu.org; Sun, 09 Oct 2005 13:57:52 -0400 Original-Received: by localhost.localdomain (Postfix, from userid 1000) id 226761E43F3; Sun, 9 Oct 2005 13:57:59 -0400 (EDT) Original-To: emacs-devel@gnu.org 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:43739 Archived-At: I've figured out the trouble I have using mouse-1-click-follows-link. It happens when I do the following (in rapid succession): * down-mouse-1 on a link * release the mouse button * move the mouse cursor somewhere else If I move the cursor away too soon, the follow-link behavior is cancelled. That's counter-intuitive, because I already released the mouse button. As a result, it *feels* as though mouse-1-click-follows-link is unreliable. The problematic code is in mouse.el: (if (and on-link ... (or remap-double-click (and (not (eq mouse-1-click-follows-link 'double)) (= click-count 0) .... (or (not double-click-time) (sit-for 0 (if (integerp double-click-time) double-click-time 500) t))))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (if (or (vectorp on-link) (stringp on-link)) (setq event (aref on-link 0)) (setcar event 'mouse-2))) (push event unread-command-events)))) The sit-for call is intended to catch a second click, so that the follow-link mechanism won't kick in when the user double-clicks. However, it also catches mouse motion, which leads to the unreliability described above. The sit-for is also responsible for the small but irritating delay between clicking on a link and the action taking place. In practice, binding double-mouse-1 doesn't seem to work for links anyway, so I suggest removing the sit-for. I've tried it out, and follow-link seems to work much more smoothly. Thoughts?