From 1b71c995da6a21c65c728b169a44113c969665dc Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 29 Apr 2022 13:57:57 +0200 Subject: [PATCH] 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). --- lisp/progmodes/xref.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)) -- 2.39.2