mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
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).
This commit is contained in:
parent
20e32f3c3f
commit
49435be616
1 changed files with 15 additions and 15 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue