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

From: Dmitry Gutov <[email-masked]>
Date: Thu, 24 Dec 2020 23:38:52 +0200

On 24.12.2020 05:36, Eli Zaretskii wrote:

> Why does project-find-regexp need to use Xref for displaying the hits?
> why not use Grep-like display we use in *grep* buffers?

These days the default Xref buffer is pretty much Grep-like. Certainly 
much closer to grep-mode than it had been in the first versions. That 
old UI was a lot more completion-like in its behavior.

This happened gradually, after we have addressed feedback from you and 
other users, so that xref-find-references and project-find-regexp behave 
  more in a fashion that you would expect from it. And those 
expectations were surely informed by Grep and other built-in modes.

Why not use something else "Grep-like"? Well, one objective reason is 
Xref is the only UI we have which is rendered programmatically based on 
a list of standardized values representing matches. Anything else would 
need work done for this to happen. And Xref has more features:

- It has a "replace in matches" command.
- Its UI with grouping by file names saves horizontal space, and it's 
actually how Grep-like search tools look these days (see ag, pt or 
ripgrep). GNU Grep doesn't have an option for such output format, so we 
help it in Elisp.
- Finally, its UI presenter is customizable, so anyone who doesn't like 
it can plug in something else that can interpret a list of "xref match" 
values. That is a good thing.