]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid binding mouse-1 in xref when mouse-1 doesn't follow links
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 29 Apr 2022 11:57:57 +0000 (13:57 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 29 Apr 2022 12:01:30 +0000 (14:01 +0200)
* 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

index 43ab703da226d58d20e5c45b820cadf550b6410a..6fa9a5c8d69c41b362aa76f3ee36cca4b61aae77 100644 (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))