From: Lars Ingebrigtsen Date: Fri, 29 Apr 2022 11:57:57 +0000 (+0200) Subject: Avoid binding mouse-1 in xref when mouse-1 doesn't follow links X-Git-Tag: emacs-29.0.90~1931^2~219 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1b71c995da6a21c65c728b169a44113c969665dc;p=emacs.git 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). --- diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 43ab703da22..6fa9a5c8d69 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -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))