* How not to list the .o files in find-dired
@ 2009-03-17 14:06 Anand Dhanakshirur
2009-03-17 15:48 ` Peter Dyballa
2009-03-17 16:11 ` thierry.volpiatto
0 siblings, 2 replies; 8+ messages in thread
From: Anand Dhanakshirur @ 2009-03-17 14:06 UTC (permalink / raw)
To: emacs help
Hi,
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?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How not to list the .o files in find-dired
2009-03-17 14:06 How not to list the .o files in find-dired Anand Dhanakshirur
@ 2009-03-17 15:48 ` Peter Dyballa
2009-03-17 16:11 ` thierry.volpiatto
1 sibling, 0 replies; 8+ messages in thread
From: Peter Dyballa @ 2009-03-17 15:48 UTC (permalink / raw)
To: Anand Dhanakshirur; +Cc: emacs help
Am 17.03.2009 um 15:06 schrieb Anand Dhanakshirur:
> 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?
dired-x ?
--
Greetings
Pete
Atheism is a non prophet organization.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How not to list the .o files in find-dired
2009-03-17 14:06 How not to list the .o files in find-dired Anand Dhanakshirur
2009-03-17 15:48 ` Peter Dyballa
@ 2009-03-17 16:11 ` thierry.volpiatto
2009-03-17 17:12 ` Drew Adams
1 sibling, 1 reply; 8+ messages in thread
From: thierry.volpiatto @ 2009-03-17 16:11 UTC (permalink / raw)
To: help-gnu-emacs
Anand Dhanakshirur <asd@cdotb.ernet.in> writes:
> Hi,
> 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?
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
--
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: How not to list the .o files in find-dired
2009-03-17 16:11 ` thierry.volpiatto
@ 2009-03-17 17:12 ` Drew Adams
2009-03-17 18:08 ` Peter Dyballa
2009-03-17 18:25 ` Peter Dyballa
0 siblings, 2 replies; 8+ messages in thread
From: Drew Adams @ 2009-03-17 17:12 UTC (permalink / raw)
To: help-gnu-emacs; +Cc: asd
> > 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How not to list the .o files in find-dired
2009-03-17 17:12 ` Drew Adams
@ 2009-03-17 18:08 ` Peter Dyballa
2009-03-17 18:25 ` Peter Dyballa
1 sibling, 0 replies; 8+ messages in thread
From: Peter Dyballa @ 2009-03-17 18:08 UTC (permalink / raw)
To: Drew Adams; +Cc: help-gnu-emacs, asd
Am 17.03.2009 um 18:12 schrieb Drew Adams:
> 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.
When the UNIX find command is behind find-dired, then
! -name "*.o"
will omit these object files. Find uses a simpel regular expressions.
--
Greetings
Pete
Think of XML as Lisp for COBOL programmers.
- Tony-A (some guy on /.)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How not to list the .o files in find-dired
2009-03-17 17:12 ` Drew Adams
2009-03-17 18:08 ` Peter Dyballa
@ 2009-03-17 18:25 ` Peter Dyballa
2009-03-18 9:18 ` Peter Dyballa
1 sibling, 1 reply; 8+ messages in thread
From: Peter Dyballa @ 2009-03-17 18:25 UTC (permalink / raw)
To: Drew Adams; +Cc: help-gnu-emacs, asd
Am 17.03.2009 um 18:12 schrieb Drew Adams:
>>> 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.
Usually find is clever enough not to search binary files ...
--
Greetings
Pete
"What do you think of Western Civilisation?"
"I think it would be a good idea!"
– Mohandas Karamchand Gandhi
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How not to list the .o files in find-dired
2009-03-17 18:25 ` Peter Dyballa
@ 2009-03-18 9:18 ` Peter Dyballa
2009-03-18 9:31 ` Anand Dhanakshirur
0 siblings, 1 reply; 8+ messages in thread
From: Peter Dyballa @ 2009-03-18 9:18 UTC (permalink / raw)
To: emacs help; +Cc: Anand Dhanakshirur
Am 17.03.2009 um 19:25 schrieb Peter Dyballa:
>>>> 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.
>
>
> Usually find is clever enough not to search binary files ...
Sorry, I mixed up things! I was thinking of find-grep – and here grep
automatically refuses to look into binaries. Find of course does not
refuse to find binaries.
--
Greetings
Pete === -Q
==<__/% >>
_____________(_)____@_____________________________
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How not to list the .o files in find-dired
2009-03-18 9:18 ` Peter Dyballa
@ 2009-03-18 9:31 ` Anand Dhanakshirur
0 siblings, 0 replies; 8+ messages in thread
From: Anand Dhanakshirur @ 2009-03-18 9:31 UTC (permalink / raw)
To: Peter Dyballa; +Cc: emacs help
I tried with ! -name *.o .
It worked.
Thanks.
Peter Dyballa wrote:
Peter Dyballa wrote:
>
> Am 17.03.2009 um 19:25 schrieb Peter Dyballa:
>
>>>>> 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.
>>
>>
>> Usually find is clever enough not to search binary files ...
>
>
> Sorry, I mixed up things! I was thinking of find-grep – and here grep
> automatically refuses to look into binaries. Find of course does not
> refuse to find binaries.
>
> --
> Greetings
>
> Pete === -Q
> ==<__/% >>
> _____________(_)____@_____________________________
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-03-18 9:31 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-17 14:06 How not to list the .o files in find-dired Anand Dhanakshirur
2009-03-17 15:48 ` Peter Dyballa
2009-03-17 16:11 ` thierry.volpiatto
2009-03-17 17:12 ` Drew Adams
2009-03-17 18:08 ` Peter Dyballa
2009-03-17 18:25 ` Peter Dyballa
2009-03-18 9:18 ` Peter Dyballa
2009-03-18 9:31 ` Anand Dhanakshirur
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).