unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Difficulty with mouse-1-click-follows-link
@ 2005-10-09 17:57 Chong Yidong
  2005-10-09 18:51 ` Romain Francoise
  0 siblings, 1 reply; 13+ messages in thread
From: Chong Yidong @ 2005-10-09 17:57 UTC (permalink / raw)
  Cc: Kim F.Storm

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?

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2005-10-14  5:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-09 17:57 Difficulty with mouse-1-click-follows-link Chong Yidong
2005-10-09 18:51 ` Romain Francoise
2005-10-10 16:46   ` Chong Yidong
2005-10-11 17:16     ` Romain Francoise
2005-10-11 21:04       ` Kim F. Storm
2005-10-11 21:20         ` Chong Yidong
2005-10-12  9:32           ` Kim F. Storm
2005-10-12 13:11             ` Chong Yidong
2005-10-12 13:37               ` Kim F. Storm
2005-10-13  4:52             ` Richard M. Stallman
2005-10-13 14:39               ` Stefan Monnier
2005-10-13 15:33               ` Chong Yidong
2005-10-14  5:10                 ` Richard M. Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).