From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.devel Subject: Re: Why does not rgrep use "grep -r"? Date: Sun, 04 Nov 2007 02:03:45 +0100 Message-ID: <472D1A71.7060903@gmail.com> References: <472B99AB.3090705@gmail.com> <87ve8k8dyw.fsf@catnip.gol.com> <878x5e25f0.fsf@kfs-lx.testafd.dk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1194138249 1955 80.91.229.12 (4 Nov 2007 01:04:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 Nov 2007 01:04:09 +0000 (UTC) Cc: Emacs Devel To: "Kim F. Storm" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 04 02:04:12 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IoTuM-0005VN-H5 for ged-emacs-devel@m.gmane.org; Sun, 04 Nov 2007 02:04:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IoTuC-00041D-0I for ged-emacs-devel@m.gmane.org; Sat, 03 Nov 2007 21:04:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IoTu9-00040t-76 for emacs-devel@gnu.org; Sat, 03 Nov 2007 21:03:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IoTu8-00040Z-Lq for emacs-devel@gnu.org; Sat, 03 Nov 2007 21:03:56 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IoTu8-00040V-JC for emacs-devel@gnu.org; Sat, 03 Nov 2007 21:03:56 -0400 Original-Received: from ch-smtp02.sth.basefarm.net ([80.76.149.213]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IoTu7-0005Z1-8R for emacs-devel@gnu.org; Sat, 03 Nov 2007 21:03:55 -0400 Original-Received: from c83-254-148-228.bredband.comhem.se ([83.254.148.228]:61857 helo=[127.0.0.1]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1IoTu5-0002og-7u; Sun, 04 Nov 2007 02:03:53 +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 In-Reply-To: <878x5e25f0.fsf@kfs-lx.testafd.dk> X-Antivirus: avast! (VPS 071103-0, 2007-11-03), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.148.228 X-Scan-Result: No virus found in message 1IoTu5-0002og-7u. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1IoTu5-0002og-7u 0313a0e487d0c7c6815a407bbe511e73 X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:82470 Archived-At: Kim F. Storm wrote: > Miles Bader writes: > >> "Lennart Borgman (gmail)" 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.