Subject: Re: bug#38797: 27.0.50; Feature request: provide the opposite of xref-pop-marker-stack

From: Juri Linkov <[email-masked]>
Date: Mon, 25 Oct 2021 20:05:33 +0300

>> LGTM, please install.
>
> Thank you Dmitry, now pushed to master.

I took a look at your change, and noticed an asymmetry
between the names xref-pop-marker-stack and xref-go-forward.
Shouldn't the name xref-pop-marker-stack be obsoleted,
and replaced with a new name xref-go-back?  (I see now
that you added FIXME for this.)

Another question is that in the menu bar currently the order is
"Forward" and "Back".  But more natural order would be
"Back" and "Forward".

> Juri, would you help out with adding (or not) `xref-go-forward` to the
> context menu? I wasn't sure if we had agreed on good names for this and the
> go-back entries. The current "Back Definition" is a bit nonsensical in
> English.

I completely agree that the current title is inappropriate.

> 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").
>
> "Xref {Back,Forward}" or "{Back,Forward} Xref" would also do and displays
> the link to Xref up front, but the English is decidedly less natural.

With such a test case:

0. emacs -Q
1. click mouse-3 on any word in *scratch*, and select from the context menu
   "Find Definition".  It should fail with the error
   "No definitions found for: This".  This is correct.
2. now click mouse-3 at the end of *scratch*, not on a word.

The menu contains the item "Back Definition".  (BTW, why if the search failed?)

This menu item is too ambiguous.  Renaming it to "Go Back" or "Go Forward"
doesn't make the menu item clearer.  Only adding a word "Xref" somewhere
will disambiguate it.  Maybe then "Go Back in Xref" or "Go Back with Xref"?
We need more opinions.