Avoid binding mouse-1 in xref when mouse-1 doesn't follow links

* lisp/progmodes/xref.el (xref--button-map): Avoid binding mouse-1
when `mouse-1-click-follows-link' is nil (bug#35353).
This commit is contained in:
Lars Ingebrigtsen 2022-04-29 13:57:57 +02:00
parent 20d3d62ec9
commit 1b71c995da

View file

@ -965,7 +965,9 @@ beginning of the line."
(defvar xref--button-map
(let ((map (make-sparse-keymap)))
(define-key map [mouse-1] #'xref-goto-xref)
(when mouse-1-click-follows-link
(define-key map [mouse-1] #'xref-goto-xref))
(define-key map [follow-link] 'mouse-face)
(define-key map [mouse-2] #'xref-select-and-show-xref)
map))