* Re: igrep-find – looking for a way to filter files
[not found] <dd53b45b-5ed2-4eed-8410-bb21cad9f00e@z24g2000prf.googlegroups.com>
@ 2008-04-29 9:05 ` Sébastien Vauban
2008-04-29 10:04 ` Thierry Volpiatto
2008-05-02 2:26 ` Kevin Rodgers
0 siblings, 2 replies; 3+ messages in thread
From: Sébastien Vauban @ 2008-04-29 9:05 UTC (permalink / raw)
To: help-gnu-emacs
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:
--8<---------------cut here---------------start------------->8---
;; 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 "))
--8<---------------cut here---------------end--------------->8---
Seb
--
Sébastien Vauban
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: igrep-find – looking for a way to filter files
2008-04-29 9:05 ` igrep-find – looking for a way to filter files Sébastien Vauban
@ 2008-04-29 10:04 ` Thierry Volpiatto
2008-05-02 2:26 ` Kevin Rodgers
1 sibling, 0 replies; 3+ messages in thread
From: Thierry Volpiatto @ 2008-04-29 10:04 UTC (permalink / raw)
To: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: igrep-find – looking for a way to filter files
2008-04-29 9:05 ` igrep-find – looking for a way to filter files Sébastien Vauban
2008-04-29 10:04 ` Thierry Volpiatto
@ 2008-05-02 2:26 ` Kevin Rodgers
1 sibling, 0 replies; 3+ messages in thread
From: Kevin Rodgers @ 2008-05-02 2:26 UTC (permalink / raw)
To: help-gnu-emacs
Sébastien Vauban wrote:
> 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.
I haven't seen the original message from Avi, but:
(setq igrep-find-prune-clause "-type d -wholename \"*.svn*\")
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-05-02 2:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <dd53b45b-5ed2-4eed-8410-bb21cad9f00e@z24g2000prf.googlegroups.com>
2008-04-29 9:05 ` igrep-find – looking for a way to filter files Sébastien Vauban
2008-04-29 10:04 ` Thierry Volpiatto
2008-05-02 2:26 ` Kevin Rodgers
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).