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: Sébastien Vauban
Subject: Re: igrep-find – looking for a way to filter files
Date: Tue, 29 Apr 2008 11:05:45 +0200
User-agent: Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.60 (gnu/linux)

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


reply via email to

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