Re: Take a deep breath...

Kohtala Marko (Marko.Kohtala@ntc.nokia.com)
18 Jul 1997 13:55:34 +0300


Riccardo Facchetti <fizban@tin.it> writes:
> On Thu, 17 Jul 1997, Raul Miller wrote:
>
> > A perverse fascination (and a long-term desire for speed) leaves me
> > wondering how non-emacs users manage large scale browsing.
>
> Not really hard to do with vi, grep and heavy use of VTs.
> Have you ever grep'ed something like 'grep foobar **/*.c' ?
> After that, you have at least 10 VTs to edit the files.

I have only seen quite awkward looking hits to how to browse a large
source tree. Here is a list of tools that I use. These tend to be fast
in finding the interesting lines and opening the file and taking to
the line.

- etags. Building of the database from Linux source takes a command
like one below in linux source root
find . -name '*.[chsS]' ! -name '*,*' | etags -
Emacs has command M-. to move definitions of the word under cursor.
Also, emacs has M-x tags-search command to search with regexp in all
appearing in TAGS file.
Many vi editors support tags made with ctags.

- id-utils. Run command mkid without arguments in Linux source root.
There is id-utils.el for emacs such that you can find all
occurrences of a word under cursor in an instant in a grep like
buffer in which you can say C-c C-c to go to the line you point to
in the grep buffer, as well as other compile mode commands. Vi users
could perhaps use the command line tools like lid for the same
purpose.

- find, xargs, grep. This is slow, but has more control over the files
searched and more options for searching. Command goes like
find . -name '*.[chsS]' | xargs grep -i 'what'
If only i386 target is interesting, something like
find . ./arch/i386 -follow -name asm-\* -prune -o -name arch -prune -o -name '*.[chsS] -print
is a better find command.
There is an emacs package for this kind of finds called igrep. Should
be available in elisp archives.

-- 
---
Marko Kohtala - Marko.Kohtala@ntc.nokia.com, Marko.Kohtala@hut.fi