bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#18212: 24.3.92; Left-click on a button is treated as mouse-2


From: Stefan Monnier
Subject: bug#18212: 24.3.92; Left-click on a button is treated as mouse-2
Date: Thu, 07 Aug 2014 14:36:42 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

> emacs -Q --exec "(global-set-key (kbd \"<down-mouse-2>\") 'clipboard-yank)" 
> --exec "(info)"
> Left-click on one of the hyperlinks.
> Emacs says
>   Buffer is read-only: #<buffer *info*>
> rather than following the hyperlink.

BTW, if you middle-click instead of left-click, you also get this error,
but you still follow the hyperlink (so you usually only see the error
if you go look for it in *Messages*).

The fundamental reason for the difference is that
mouse-1-click-follows-link defaults to 450, which means that we can't
decide whether the down-mouse-1 should be turned into a down-mouse-2 or
not until either we see the subsequent mouse-1 or 450ms have passed.
In this case, the 450ms typically don't pass, but we had to wait for the
mouse-1 to arrive.  At that point we turn those two events into
down-mouse-2 and mouse-2.  So it looks just the same as what happens for
a middle-click.  The crucial difference is that when the command bound
to down-mouse-2 is run, we have already received the mouse-1 (aka
mouse-2), and since errors have the side effect of emptying the "not yet
processed input", the error on down-mouse-2 ends up canceling the
subsequent mouse-1/2.

I installed the workaround below,


        Stefan


--- lisp/info.el        2014-03-14 20:51:22 +0000
+++ lisp/info.el        2014-08-07 18:28:18 +0000
@@ -3994,6 +3994,7 @@
     (define-key map "," 'Info-index-next)
     (define-key map "\177" 'Info-scroll-down)
     (define-key map [mouse-2] 'Info-mouse-follow-nearest-node)
+    (define-key map [down-mouse-2] 'ignore) ;Override potential global binding.
     (define-key map [follow-link] 'mouse-face)
     (define-key map [XF86Back] 'Info-history-back)
     (define-key map [XF86Forward] 'Info-history-forward)






reply via email to

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