Subject: Re: bug#44611: Prefix arg for xref-goto-xref

From: Juri Linkov <[email-masked]>
Date: Tue, 22 Dec 2020 10:58:35 +0200

>> And since the new keybinding have no disastrous effect, it would safer
>> for the users to adapt to the new keybinding.
>
> What disastrous effects?  AFAICT, TAB buries the XREF buffer, which is
> not a disaster.

It takes the same amount of efforts to bring it back: either by finding
the buried buffer in the buffer list, or running project-find-regexp again.

> More generally, I think it's wrong to try to make XREF buffers behave
> like *Grep* buffers.  They are different beasts, I think we
> established this long ago, when Xref was added to Emacs (I think I
> even made a comment regarding the difference, and Dmitry responded to
> the effect that this was intended).  *XREF* and *Grep* look
> differently and behave differently, and it's impossible to make them
> be similar enough.

They might be different when *xref* is used as a completions buffer
when the *xref* buffer is created by 'M-.' (xref-find-definitions).

Moreover, now it's possible to use the real *Completions* buffer by
customizing xref-show-definitions-function to xref--show-defs-minibuffer.
Even is this case TAB doesn't close the *Completions* buffer.

But a completely separate case is when the *xref* buffer is created
by such grep-like commands as project-find-regexp.

So currently there are two different uses of the *xref* buffer:

1. as a transient completions buffer that could be buried
   after a completion is selected from the buffer;
2. as a grep buffer for visiting the found matches.

In the second case, it's natural to type TAB to navigate results.

Should these cases use different modes with different buffer names?
Such as a buffer name *xgrep*?