GNU bug report logs - #38797
27.0.50; Feature request: provide the opposite of xref-pop-marker-stack

Previous Next

Package: emacs;

Reported by: yyoncho <yyoncho <at> gmail.com>

Date: Sun, 29 Dec 2019 18:12:02 UTC

Severity: wishlist

Tags: patch

Found in version 27.0.50

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Mattias EngdegÄrd <mattiase <at> acm.org>
Cc: 38797 <at> debbugs.gnu.org, yyoncho <yyoncho <at> gmail.com>, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: bug#38797: 27.0.50; Feature request: provide the opposite of xref-pop-marker-stack
Date: Mon, 08 Nov 2021 20:23:06 +0200
[Message part 1 (text/plain, inline)]
> I favour (lightly) "Go Back" / "Go Forward" because they make sense in
> context with the other Xref operations in that separator-delimited group of
> entries in the menu, and because it's a wording often used for these
> operations elsewhere such as in web browsers and IDEs (though often it's
> just "Back" and "Forward").

There are more votes for "Go Back" / "Go Forward", so I'll push
two patches - one for emacs-28 (not to be merged to master), and
another for master:

[go-back-emacs-28.patch (text/x-diff, inline)]
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
index 3e1a915e32..4997c2746f 100644
--- a/lisp/progmodes/prog-mode.el
+++ b/lisp/progmodes/prog-mode.el
@@ -51,7 +51,7 @@ prog-context-menu
 
   (unless (xref-marker-stack-empty-p)
     (define-key-after menu [xref-pop]
-      '(menu-item "Back Definition" xref-pop-marker-stack
+      '(menu-item "Go Back" xref-pop-marker-stack
                   :help "Back to the position of the last search")
       'prog-separator))
 
[go-back-master.patch (text/x-diff, inline)]
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
index db350a5f70..30b6edf0d9 100644
--- a/lisp/progmodes/prog-mode.el
+++ b/lisp/progmodes/prog-mode.el
@@ -49,9 +49,15 @@ prog-context-menu
   (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))
 

This bug report was last modified 3 years and 188 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.