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

* bug#25715: 25.1; goto-address-mode with custom keymap yanks text on click
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-26 14:11 UTC (permalink / raw)
  To: James Bunton; +Cc: 25715

James Bunton <jamesbunton@delx.net.au> writes:

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

(I'm going through older Emacs bug reports that have received no
response.)

This looks like it's been fixed in the years since you made the bug
report.  The definition of the keymap is now:

(defvar goto-address-highlight-keymap
  (let ((m (make-sparse-keymap)))
    (define-key m (kbd "<mouse-2>") 'goto-address-at-point)
    (define-key m (kbd "C-c RET") 'goto-address-at-point)
    m)
  "Keymap to hold goto-addr's mouse key defs under highlighted URLs.")

So I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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