Subject: bug#49731: 28.0.50; Filter xref results by filename

From: Eli Zaretskii <[email-masked]>
Date: Sun, 25 Jul 2021 12:10:37 +0300

> Date: Sun, 25 Jul 2021 10:19:52 +0200
> From:  Daniel Martín via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> 
> I plan to implement a new feature for xref, but I'd like to get some
> opinions first:
> 
> Sometimes an xref backend returns a lot of results spread over several
> files.  This usually happens in huge projects and for certain operations
> like "search references".  To make them more manageable, I propose a new
> command that can filter xref result groups (typically filenames) by a
> regular expression.  A user could filter by "tests/", or something like
> that, to only get results from unit tests.  If you want to see a similar
> feature in action, go to
> https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/background/background_contents.cc;bpv=1;bpt=1
> and type on "Type to filter by file path", under the "References" tab.

I cannot see anything useful at that URL for some reason, so couldn't
get a clear idea of what would be the result of the proposed feature.
Can you describe it in more detail?

In particular, does "filtering by file names" mean you'd leave only
some of the matches in the XREF buffer, or does it mean something
else?

More generally, I wonder what are the purposes of this feature.
Filtering is a means, but what are the ends here?  Can you describe a
couple of use cases that would provide the context for the feature and
its projected uses?

Thanks.