From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?iso-8859-1?Q?S=E9bastien_Vauban?= Newsgroups: gmane.emacs.help Subject: Re: igrep-find =?utf-8?b?4oCT?= looking for a way to filter files Date: Tue, 29 Apr 2008 11:05:45 +0200 Organization: Sebastien Vauban Message-ID: <87mynd81zq.fsf@mundaneum.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1209462100 30918 80.91.229.12 (29 Apr 2008 09:41:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Apr 2008 09:41:40 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 29 11:42:17 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JqmLh-00024a-93 for geh-help-gnu-emacs@m.gmane.org; Tue, 29 Apr 2008 11:42:09 +0200 Original-Received: from localhost ([127.0.0.1]:46738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JqmL0-0001Ee-8y for geh-help-gnu-emacs@m.gmane.org; Tue, 29 Apr 2008 05:41:26 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!kanaga.switch.ch!switch.ch!feeder2.ecngs.de!ecngs!feeder.ecngs.de!feed1.news.be.easynet.net!reader0.news.be.easynet.net!not-for-mail Original-Newsgroups: gnu.emacs.help X-Www-site: Under construction... User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:InB7IQGO5FolZhQ+AqJCX5fzaEc= Original-Lines: 35 Original-NNTP-Posting-Date: 29 Apr 2008 09:05:46 GMT Original-NNTP-Posting-Host: 81.188.7.152 Original-X-Trace: 1209459946 reader0.news.be.easynet.net 1585 [::ffff:81.188.7.152]:51857 Original-X-Complaints-To: abuse@be.easynet.net Original-Xref: shelby.stanford.edu gnu.emacs.help:158251 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:53616 Archived-At: 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*" =E2=80=93prune 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 -p= rint0" " | xargs -0 -e grep -i -n -e ")) --8<---------------cut here---------------end--------------->8--- Seb --=20 S=C3=A9bastien=C2=A0Vauban