emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 49435be 1/6: Add xref operations to context menu unconditionally


From: Mattias Engdegård
Subject: master 49435be 1/6: Add xref operations to context menu unconditionally
Date: Sat, 21 Aug 2021 06:56:43 -0400 (EDT)

branch: master
commit 49435be616c14d5080e4147ca05204bea5cb1d4f
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    Add xref operations to context menu unconditionally
    
    * lisp/progmodes/prog-mode.el (prog-context-menu):
    Add xref operations to the context menu even if xref hasn't been
    loaded yet; the functions involved are autoloaded (bug#50067).
---
 lisp/progmodes/prog-mode.el | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
index a8b608b..4f000d6 100644
--- a/lisp/progmodes/prog-mode.el
+++ b/lisp/progmodes/prog-mode.el
@@ -44,21 +44,21 @@
                                 prettify-symbols-mode))
 
 (defun prog-context-menu (menu)
-  (when (featurep 'xref)
-    (define-key-after menu [prog-separator] menu-bar-separator
-      'mark-whole-buffer)
-    (define-key-after menu [xref-find-def]
-      '(menu-item "Find Definition" xref-find-definitions-at-mouse
-                  :visible (save-excursion
-                             (mouse-set-point last-input-event)
-                             (xref-backend-identifier-at-point 
(xref-find-backend)))
-                  :help "Find definition of function or variable")
-      'prog-separator)
-    (define-key-after menu [xref-pop]
-      '(menu-item "Back Definition" xref-pop-marker-stack
-                  :visible (not (xref-marker-stack-empty-p))
-                  :help "Back to the position of the last search")
-      'xref-find-def))
+  (define-key-after menu [prog-separator] menu-bar-separator
+    'mark-whole-buffer)
+  (define-key-after menu [xref-find-def]
+    '(menu-item "Find Definition" xref-find-definitions-at-mouse
+                :visible (save-excursion
+                           (mouse-set-point last-input-event)
+                           (xref-backend-identifier-at-point
+                            (xref-find-backend)))
+                :help "Find definition of function or variable")
+    'prog-separator)
+  (define-key-after menu [xref-pop]
+    '(menu-item "Back Definition" xref-pop-marker-stack
+                :visible (not (xref-marker-stack-empty-p))
+                :help "Back to the position of the last search")
+    'xref-find-def)
   menu)
 
 (defvar prog-mode-map



reply via email to

[Prev in Thread] Current Thread [Next in Thread]