From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.help Subject: Re: igrep-find =?utf-8?b?4oCT?= looking for a way to filter files Date: Tue, 29 Apr 2008 12:04:52 +0200 Message-ID: <87ve21t1rv.fsf@thievol.homelinux.org> References: <87mynd81zq.fsf@mundaneum.com> 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 1209463424 3879 80.91.229.12 (29 Apr 2008 10:03:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Apr 2008 10:03:44 +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 12:04:18 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 1Jqmh4-0000KQ-2J for geh-help-gnu-emacs@m.gmane.org; Tue, 29 Apr 2008 12:04:14 +0200 Original-Received: from localhost ([127.0.0.1]:56382 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JqmgN-0001x5-Es for geh-help-gnu-emacs@m.gmane.org; Tue, 29 Apr 2008 06:03:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jqmg1-0001wD-AN for help-gnu-emacs@gnu.org; Tue, 29 Apr 2008 06:03:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jqmfy-0001tQ-74 for help-gnu-emacs@gnu.org; Tue, 29 Apr 2008 06:03:08 -0400 Original-Received: from [199.232.76.173] (port=43999 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jqmfx-0001sx-UF for help-gnu-emacs@gnu.org; Tue, 29 Apr 2008 06:03:05 -0400 Original-Received: from nf-out-0910.google.com ([64.233.182.185]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jqmfx-0002Tq-89 for help-gnu-emacs@gnu.org; Tue, 29 Apr 2008 06:03:05 -0400 Original-Received: by nf-out-0910.google.com with SMTP id c7so43811nfi.26 for ; Tue, 29 Apr 2008 03:03:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:references:date:in-reply-to:message-id:user-agent:mime-version:content-type:content-transfer-encoding; bh=a0fnIGbWjCDuyQ6HvM8lzL/4Xxa1zTd5pwWxQiiozPE=; b=jmxEeW71vGYIJ//uNrbEbfnYVY8TwS+gB68drWX0k2T04DtDtt/2/hr3f7cQ7GMBwhOOr4/ZpMT3FUuxcfHcHE3FBevr6tNK3UoxjfPv3sjk2KhIiea1GfuhYS5fPw2fLp8Kn/pf9dljmVOmz5Ia5frVUiGgZVcVudCnYHx8g4Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:references:date:in-reply-to:message-id:user-agent:mime-version:content-type:content-transfer-encoding; b=bGNoDpkdGAkn5tpu8m1lus8vVwdI0DvLqTNpkyzKO158yJ1NTSs6kl4GJ0f/KTMENDMLZv/xx03JyMS7tnFV5P5+fA0pN7jOQNwd0ohk8/EauHbEey3rKtu2xmbkqIBGtu2DnXBQfc3fOt8CUkmNBTiC84e/BEk5yjeRV8uEbUs= Original-Received: by 10.210.13.17 with SMTP id 17mr7129305ebm.94.1209463381974; Tue, 29 Apr 2008 03:03:01 -0700 (PDT) Original-Received: from thievol.homelinux.org ( [77.197.77.156]) by mx.google.com with ESMTPS id b9sm11174595mug.12.2008.04.29.03.02.59 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 29 Apr 2008 03:03:00 -0700 (PDT) In-Reply-To: <87mynd81zq.fsf@mundaneum.com> (=?utf-8?Q?=22S=C3=A9bastien?= Vauban"'s message of "Tue, 29 Apr 2008 11:05:45 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:53617 Archived-At: S=C3=A9bastien Vauban 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*" =E2=80=93prune 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) --=20 A + Thierry Pub key: http://pgp.mit.edu