emacs-devel
[Top][All Lists]
Advanced

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

Re: Why does not rgrep use "grep -r"?


From: Lennart Borgman (gmail)
Subject: Re: Why does not rgrep use "grep -r"?
Date: Sun, 04 Nov 2007 02:03:45 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666

Kim F. Storm wrote:
Miles Bader <address@hidden> writes:

"Lennart Borgman (gmail)" <address@hidden> writes:
If grep can do recursive searches then why not use that in rgrep?
I don't know the reason of the rgrep authors (though I suspect it was
portability concerns),

Yes portability was definitely a concern.

When I first wrote the code years ago, grep -r wasn't widely supported,
so I wrote it to use find, xargs, and grep.

Later when I integrated rgrep into Emacs 22.1, I reworked quite a lot
of the existing grep & find stuff so that the old grep and grep-find, and
the new lgrep and rgrep commands could share a common code base.

Since both grep-find and my rgrep code used find/xargs/grep, I decided
to continue using them, even though grep -r could have been an alternative.

But I was still concerned about portability, and since using find
worked just nicely, I saw no reason to change.  Besides, as you and
others have noted, grep -r has severe performance problems on some
platforms.

It probably wouldn't be difficult to make it used grep -r (as an
_optional alternative_), but the current code works nicely and is well
tested, so why mess with it?

I thought performance was one reason, but maybe not.

However there are other problems, at least on w32. Try a search with a space in it. That works with lgrep, but not with rgrep. -- At least that is true when you are using the utilities from GnuWin32.

So I suggest that the default on w32 is changed to use grep -r.




reply via email to

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