From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1542 invoked by alias); 26 Feb 2002 08:23:39 -0000 Mailing-List: contact sourcenav-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: sourcenav-owner@sources.redhat.com Received: (qmail 1430 invoked from network); 26 Feb 2002 08:23:34 -0000 Received: from unknown (HELO shell4.bayarea.net) (209.128.82.1) by sources.redhat.com with SMTP; 26 Feb 2002 08:23:34 -0000 Received: from modrick (209-128-79-218.BAYAREA.NET [209.128.79.218]) by shell4.bayarea.net (8.9.3/8.9.3) with SMTP id AAA10954 for ; Tue, 26 Feb 2002 00:23:34 -0800 (envelope-from supermo@bayarea.net) Date: Tue, 26 Feb 2002 00:55:00 -0000 From: Mo DeJong To: sourcenav Subject: Re: No grep module? Message-Id: <20020226002237.5bbbc105.supermo@bayarea.net> In-Reply-To: <878z9lowq5.fsf@creche.redhat.com> References: <20020222155242.249517de.supermo@bayarea.net> <878z9lowq5.fsf@creche.redhat.com> Organization: House of Mirth X-Mailer: Sylpheed version 0.4.99cvs6 (GTK+ 1.2.7; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2002-q1/txt/msg00130.txt.bz2 On 22 Feb 2002 17:41:54 -0700 Tom Tromey wrote: > >>>>> "Mo" == Mo DeJong writes: > > Mo> If we do want to add a grep module to support building under > Mo> Windows, then perhaps we need to upgrade to a more recent version > Mo> of GNU grep. I think we removed all the old custom grep hacks that > Mo> we were using, so we should be able to upgrade. > > What about hacking S-N to load files and do its own regexp matching, > thus avoiding the need for a separate grep executable? I think in the > past grep was used for better performance. Is it really that > significant? > > Tom We looked into doing that for the last release but it just was not going to work. This time around, we are using Tcl 8.3 so we have access to the new regexp impl that supports the following: % regexp -all -inline -indices {oy} { a toy is not a boy soy is a joy } {4 5} {17 18} {21 22} {30 31} We can build up a buffer the size of the file and then run regexp to find all the match indexes. The tricky part will be how we will count newlines so that a match index can be mapped back to the file line number. Then there is the code in greppane.tcl to worry about. It is kind of scary the way we run multiple greps to get around OS command line limits. Also, we currently run another regexp over each result line so that we can highlight the match text. This all adds up to lots of time we could save with a Tcl based grep impl. Then there is the really nasty hack that we use to map the file names returned from grep back to files in the project. Then there are the PATH problems that can cause the wrong version of grep to be run. We could really fix a lot of problems with a Tcl only version of grep. That said, actually getting this code written and added might not be something that is doable for the 5.1 release. Perhaps we should just punt on a grep module and include a grep.exe in the Windows zip file for the binaries. Mo