[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
- master updated (20e32f3 -> f415956), Mattias Engdegård, 2021/08/21
- master 4d6e770 2/6: Re-type the :location slot in `xref-match-item` to `xref-location`, Mattias Engdegård, 2021/08/21
- master 6993d45 4/6: Add "Find References" to context menu (bug#50067), Mattias Engdegård, 2021/08/21
- master b483090 3/6: Indicate progress while searching for references in xref, Mattias Engdegård, 2021/08/21
- master 49435be 1/6: Add xref operations to context menu unconditionally,
Mattias Engdegård <=
- master f415956 6/6: Remove default "Select" title from NS popup menus (bug#50067), Mattias Engdegård, 2021/08/21
- master d6ad208 5/6: Use overlay arrow to indicate current *xref* selection, Mattias Engdegård, 2021/08/21