emacs-devel
[Top][All Lists]
Advanced

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

Difficulty with mouse-1-click-follows-link


From: Chong Yidong
Subject: Difficulty with mouse-1-click-follows-link
Date: Sun, 09 Oct 2005 13:57:59 -0400

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?




reply via email to

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