From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Matthew Woodcraft <matthew@woodcraft.me.uk>
Cc: 18212-done@debbugs.gnu.org
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 [thread overview]
Message-ID: <jwvzjfg6ukr.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <87vbq5nypa.fsf@golux.woodcraft.me.uk> (Matthew Woodcraft's message of "Wed, 06 Aug 2014 21:35:29 +0100")
> 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)
next prev parent reply other threads:[~2014-08-07 18:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-06 20:35 bug#18212: 24.3.92; Left-click on a button is treated as mouse-2 Matthew Woodcraft
2014-08-06 23:59 ` Glenn Morris
2014-08-07 13:08 ` Stefan Monnier
2014-08-07 18:36 ` Stefan Monnier [this message]
2014-08-07 21:02 ` Matthew Woodcraft
2014-08-08 2:28 ` Stefan Monnier
2014-08-08 18:38 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvzjfg6ukr.fsf-monnier+emacsbugs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=18212-done@debbugs.gnu.org \
--cc=matthew@woodcraft.me.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.