From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: How not to list the .o files in find-dired Date: Tue, 17 Mar 2009 10:12:10 -0700 Message-ID: <006801c9a723$83d973d0$0200a8c0@us.oracle.com> References: <49BFAE6B.8010407@cdotb.ernet.in> <87ljr45dtx.fsf@tux.homenetwork> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1237309968 26260 80.91.229.12 (17 Mar 2009 17:12:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Mar 2009 17:12:48 +0000 (UTC) Cc: asd@cdotb.ernet.in To: Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 17 18:14:05 2009 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 1LjcrN-0002dN-2Y for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Mar 2009 18:13:49 +0100 Original-Received: from localhost ([127.0.0.1]:41134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ljcq0-0007kH-6q for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Mar 2009 13:12:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ljcpd-0007hs-KK for help-gnu-emacs@gnu.org; Tue, 17 Mar 2009 13:12:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LjcpY-0007gY-Me for help-gnu-emacs@gnu.org; Tue, 17 Mar 2009 13:12:00 -0400 Original-Received: from [199.232.76.173] (port=36991 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LjcpY-0007gV-HJ for help-gnu-emacs@gnu.org; Tue, 17 Mar 2009 13:11:56 -0400 Original-Received: from acsinet12.oracle.com ([141.146.126.234]:48708) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LjcpY-0002z3-36 for help-gnu-emacs@gnu.org; Tue, 17 Mar 2009 13:11:56 -0400 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by acsinet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n2HHBOi0026827 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 17 Mar 2009 17:11:26 GMT Original-Received: from acsmt704.oracle.com (acsmt704.oracle.com [141.146.40.82]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n2HHBjCg003606; Tue, 17 Mar 2009 17:11:46 GMT Original-Received: from dradamslap1 (/141.144.88.190) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 17 Mar 2009 10:11:40 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87ljr45dtx.fsf@tux.homenetwork> Thread-Index: AcmnHGOtW3sO2nojR7y6bQoYLkCQlQAA01Jw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Source-IP: acsmt704.oracle.com [141.146.40.82] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090202.49BFD9CE.020F:SCFSTAT928724,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) 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:63016 Archived-At: > > The find-dired lists all the files recursively under a directory. > > But i don't want to list the .o files and backup files. > > How to do that? `find-dired' is a wrapper for the UNIX-GNU/Linux `find' command. `find' lets you specify the filenames to match. You should be able to specify something like `-name *.[^o~]' as the file-name pattern to match (you might need a more complex pattern). I've forgotten what I knew in a former life about `find' (which is a language unto itself!), but perhaps someone else can give you a precise incantation. Someone else also mentioned Dired X. It lets you omit files with certain extensions. But that does not affect what `find' sees; it affects only what Dired sees. It can perhaps be useful once `find-dired' has gathered files into a Dired buffer (to let you omit some of them), but I don't think it will help prevent `find-dired' from finding certain files. > traverselisp.el do that and you can setup a list of files to ignore in > `traverse-ignore-files'. You can put a plain name of file, a regexp > matching file-name, or an extension of file in this list. > You can match also only certain types of files or ext files. > Traverselisp have also an anything extension that list files > recursively in current-dir (with same options). > See in emacswiki: traverselisp.el anything-traverse.el Anything You can also use Icicles to do what you want. Use `icicle-locate-file'. Type the file-name pattern you want to match (you can use a regexp). You can match any parts of the file names, including directory components. To then eliminate .o and backup files from the matching files, hit `M-SPC' to also match another pattern. For the second pattern, type `\.o$' (to get just the .o files), then hit `C-~' to remove those (the .o files) from the list of candidates. Similarly, to eliminate backup files from the list (the backup pattern you use depends on your backup naming convention). You can use `M-SPC' for any number of patterns to match the files you need - use `C-~' to match negatively. Think of `M-SPC' as set interesection and `C-~' as set complement. This gives you a complete list of all files under some directory that match your input pattern, except for the .o and backup files. The names in this list are candidates for completion. You can act on one or more of them immediately (using `RET' or `C-RET'), to open it, or you can save the list for later use (persistently, if you like). You can also open Dired on the files in the list. That will give you just what you asked for: Dired for all and only the files you want under some directory, regardless of which subdirectories they are from. And, if you saved the list persistently (see above), then you can later reopen Dired on just those files in any subsequent Emacs session. See: http://www.emacswiki.org/emacs/Icicles_-_File-Name_Input http://www.emacswiki.org/emacs/Icicles_-_Persistent_Completions http://www.emacswiki.org/emacs/Icicles_-_Dired_Enhancements http://www.emacswiki.org/emacs/Icicles_-_Support_for_Projects