help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: igrep-find – looking for a way to filter files


From: Thierry Volpiatto
Subject: Re: igrep-find – looking for a way to filter files
Date: Tue, 29 Apr 2008 12:04:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Sébastien Vauban <zthjwsqqafhv@spammotel.com> writes:

> Hi Avi,
>
>> Is there a way to filter the files that will be searched by
>> igrep- find ?
>> I want to eliminate certain patterns from the search. For
>> example, I want to apply the filter pattern: -wholename
>> "*.svn*" –prune in order to avoid searching in svn sub
>> directories.
>
> This is the code I'm using for me, myself and I:
>
> ;; search for files with names matching a wild card pattern and dired the
> ;; output
> (global-set-key [(control c) ?1] 'find-name-dired)
>
> ;; search for files with contents matching a wild card pattern and dired the
> ;; output
> (global-set-key [(control c) ?2] 'find-grep-dired)
>
> ;; run grep via find, with user-specified arguments
> (global-set-key [(control c) ?3] 'grep-find)
>
> ;; ignore `.svn' and `CVS' directories
> (setq grep-find-command
>       (concat
>        "find . \\( -path '*/.svn' -o -path '*/CVS' \\) -prune -o -type f 
> -print0"
>               " | xargs -0 -e grep -i -n -e "))
>
> Seb
Hello,
have a look also at TraverseDirectory.

http://www.emacswiki.org/cgi-bin/wiki/TraverseDirectory

It don't work with the find command but with an external python program.
It can be use with the egrep interface or in muse-mode.
You can configure the repertory (.svn etc...) or the files (.elc etc...)
to ignore in a special file (.traverse.cfg) with an very easy syntax.

The mode (pygrep-mode) that work with muse is now very nice and can be
integrated also in planner to find all the todos of one project.
(you will find the link to the planner file in TraverseDirectory also)

-- 
A + Thierry
Pub key: http://pgp.mit.edu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]