emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Should project delegate project-find-regexp?


From: Ergus
Subject: Re: Should project delegate project-find-regexp?
Date: Thu, 7 Apr 2022 14:34:06 +0200

On Thu, Apr 07, 2022 at 09:48:33PM +1000, Joel Reicher wrote:
It seems to me that, at least in the case of git, 'git grep' offers a
superior implementation to anything offered by the generic
implementation of project-find-regexp.

At the moment project delegates the list of files to vc (for example)
but perhaps it should delegate the regexp search itself?

I think it could and the implementation itself is not very complex to do
for this specific use case, the problem is that vc if a general frontend
for many vcs, and most of them does not support regex search... On the
other end project.el itself is agnostic respecting to the vc (or the
backend) in use, so to support this it may be needed some kind of
desicion between the two ends to use git specific code in the vc-side
adding a regex function wrapper that will only work for git..

OTOH the current implementation relies on the xref-matches-in-files
which will respect all the xref customs implied (like
xref-search-program) reusing all the existing code to match patterns,
and read the outputs from the processes.

In practice I know that git grep is good, but I am not sure how
"superior" is it compared to what we already have and if it worth to use
it.

Are there any real difference?

Regards,

       - Joel

Best,
Ergus


reply via email to

[Prev in Thread] Current Thread [Next in Thread]