unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#25715: 25.1; goto-address-mode with custom keymap yanks text on click
@ 2017-02-14  1:31 James Bunton
  2019-07-26 14:11 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: James Bunton @ 2017-02-14  1:31 UTC (permalink / raw)
  To: 25715

I use goto-address-mode, but I want to be able to left-click inside a
link without opening it. I've modified the goto-address-highlight-keymap
to accomplish this.

I can reproduce the problem easily with `emacs -Q`. Put the text below
into a buffer and use C-M-x to evalue the two top-level forms. At this
point I would expect clicking on the link to set the point and do
nothing else. Instead it yanks text into the buffer.

I have discovered that adding an extra ignored keybinding for mouse-2
fixes the problem. This confuses me because I'm only ever pressing my
left mouse button, mouse-1.

This seems like a bug to me :)

Thanks for looking!

--

James



;; demo text starts here
;; http://example.com

(goto-address-mode 1)

(setq goto-address-highlight-keymap
      (let ((m (make-sparse-keymap)))
        (define-key m (kbd "C-<mouse-1>") 'goto-address-at-point)
;;        (define-key m (kbd "<mouse-2>") 'ignore) ; uncomment this line
to workaround the bug
        (define-key m (kbd "C-c RET") 'goto-address-at-point)
        m))
;; demo text ends here





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

end of thread, other threads:[~2019-07-26 14:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-14  1:31 bug#25715: 25.1; goto-address-mode with custom keymap yanks text on click James Bunton
2019-07-26 14:11 ` Lars Ingebrigtsen

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).