public inbox for sourcenav@sourceware.org
 help / color / mirror / Atom feed
From: Mo DeJong <supermo@bayarea.net>
To: sourcenav <sourcenav@sources.redhat.com>
Subject: Re: No grep module?
Date: Tue, 26 Feb 2002 00:55:00 -0000	[thread overview]
Message-ID: <20020226002237.5bbbc105.supermo@bayarea.net> (raw)
In-Reply-To: <878z9lowq5.fsf@creche.redhat.com>

On 22 Feb 2002 17:41:54 -0700
Tom Tromey <tromey@redhat.com> wrote:

> >>>>> "Mo" == Mo DeJong <supermo@bayarea.net> 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




      reply	other threads:[~2002-02-26  8:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-22 16:16 Mo DeJong
2002-02-23 15:35 ` Tom Tromey
2002-02-26  0:55   ` Mo DeJong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020226002237.5bbbc105.supermo@bayarea.net \
    --to=supermo@bayarea.net \
    --cc=sourcenav@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).