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?