[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: File System Traversal Map/Collect

From: Drew Adams
Subject: RE: File System Traversal Map/Collect
Date: Sun, 1 Jun 2008 12:41:41 -0700

> > I am trying to construct a general file system traversal function
> > which operates (map/collect) on each file using a function as
> > argument. Such a function could be query-replace-regexp() 
> > specializing it to the functions found in findr.el.
> M-x find-name-dired then the M and Q command in the resulting
> Dired buffer allows to make a query replacement on a
> bunch of files. The command find-name-dired makes use of the
> unix find command though, so it is perhaps not so useful with
> respect to what you want to achieve.
> There is also an extension called icicles which
> seems to be able to do what you want -- apply
> a function to a bunch of files, without relying on
> some unix find command. Have a look at the wiki.

In addition to what I mentioned in my previous reply - 

If you just want to do what `query-replace-regexp' does, instead of mapping an
arbitrary function over files, then you can use `icicle-search'. You can use it
with a saved set of file names, which you can create using `icicle-locate-file',
as I mentioned previously.

You can replace the current search hit at any time, which gives you behavior
similar to `query-replace' but without requiring you to visit each occurrence
and answer whether or not you want to replace it. You can visit only the hits
you want, and replacement of any given hit is only on demand (`C-S-RET'). 

You can also change the replacement string at any time, and it can be anything
that is allowed as a replacement by 'query-replace-regexp', which includes Lisp
sexp evaluation via `\,'.


reply via email to

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