summaryrefslogtreecommitdiff
path: root/lisp/progmodes/prog-mode.el
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2021-08-21 10:59:54 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2021-08-21 12:41:53 +0200
commit49435be616c14d5080e4147ca05204bea5cb1d4f (patch)
tree1bd3ae9f7f286987aa2e16626280946e8c7462ec /lisp/progmodes/prog-mode.el
parent20e32f3c3fee1446768786c04b52cde4ce313e37 (diff)
downloademacs-49435be616c14d5080e4147ca05204bea5cb1d4f.tar.gz
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).
Diffstat (limited to 'lisp/progmodes/prog-mode.el')
-rw-r--r--lisp/progmodes/prog-mode.el30
1 files changed, 15 insertions, 15 deletions
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
index a8b608b018a..4f000d6613a 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