Subject: bug#28814: [BUMP, PATCH] (26.0.90; When *xref* window is needed, original window-switching intent is lost )

From: Eli Zaretskii <[email-masked]>
Date: Wed, 25 Oct 2017 18:11:01 +0300

> Cc: [email-masked], [email-masked]
> From: Dmitry Gutov <[email-masked]>
> Date: Wed, 25 Oct 2017 03:24:58 +0300
> 
> On 10/23/17 11:03 PM, João Távora wrote:
> 
> > I read the discussion you pointed me to me by Dmitry in
> > http://lists.gnu.org/archive/html/emacs-devel/2016-01/msg01235.html.
> > 
> > Eli, If I understand your concerns there, then the first and third
> > patches I proposed shouldn't in any way interfere with your use of
> > *xref*-related facilities.  If anything, they should improve it.
> 
> Overall, I don't have strong objections, so if Eli is fine with the new 
> behavior all around, I don't mind getting them in (with maybe a few 
> modifications), and hopefully we'll reach some better solutions by the 
> next release.

Sorry, guys: I will have to take you several steps back, because I got
lost in the details of your discussion.

I understand that the motivation for changing the existing solution
for the "disappearing XREF buffer" was the unexpected or even
incorrect behavior when the "C-x 4" variety of the commands is
invoked.  That is, the existing code would display the definition in
the original window, not in "the other" window (which is taken by the
XREF buffer).  And the original solution was to display the definition
in the window where the XREF buffer was displayed, thus making it
"disappear".  Is that correct?

If so, then the easiest solution IMO would be to pop up one more
window, i.e. behave as if the window displaying the XREF buffer didn't
exist.  That would both keep the contract of "C-x 4" and leave the
XREF buffer visible.

As for quitting the XREF buffer when it's no longer needed: how about
'q', like other similar modes do, or some variety thereof?  "C-u RET"
is too odd, almost outlandish in Emacs.

If the above solves the remaining issues, and if you have no other
problems, can we have patches to that effect?

And then the next question would be: what branch to install this on?

Thanks, and sorry for keeping silence until now.