summaryrefslogtreecommitdiff
path: root/lisp/progmodes/prog-mode.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2021-11-09 10:24:44 +0200
committerJuri Linkov <juri@linkov.net>2021-11-09 10:24:44 +0200
commit5e393e2a97398ac4c6335d83d04b94ba8a74982a (patch)
tree3ac0eb28ba5b5378b89513db88dfe460fc25df52 /lisp/progmodes/prog-mode.el
parent565514fe96a575ceda2db229ac2dc7a78c2f9abd (diff)
downloademacs-5e393e2a97398ac4c6335d83d04b94ba8a74982a.tar.gz
* lisp/progmodes/prog-mode.el (prog-context-menu): Add "Go Forward".
The menu item "Go Forward" is bound to xref-go-forward. Also use "Go Back" for xref-go-back (bug#38797).
Diffstat (limited to 'lisp/progmodes/prog-mode.el')
-rw-r--r--lisp/progmodes/prog-mode.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
index db350a5f704..30b6edf0d9d 100644
--- a/lisp/progmodes/prog-mode.el
+++ b/lisp/progmodes/prog-mode.el
@@ -49,9 +49,15 @@
(define-key-after menu [prog-separator] menu-bar-separator
'middle-separator)
+ (unless (xref-forward-history-empty-p)
+ (define-key-after menu [xref-forward]
+ '(menu-item "Go Forward" xref-go-forward
+ :help "Forward to the position gone Back from")
+ 'prog-separator))
+
(unless (xref-marker-stack-empty-p)
(define-key-after menu [xref-pop]
- '(menu-item "Back Definition" xref-go-back
+ '(menu-item "Go Back" xref-go-back
:help "Back to the position of the last search")
'prog-separator))