unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* recursive query replace regexp
@ 2003-01-14 12:49 Per Nordlöw
  2003-01-14 13:34 ` Christopher J. White
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Per Nordlöw @ 2003-01-14 12:49 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 259 bytes --]

Is there any way to perform an interactive replace (query-replace) of
regular expressions recursively in all or some (specified by a regular
expression) files present in a directory tree.


Many thanks in advance,

Per Nordlöw
Swedish Defense Research Agency

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: recursive query replace regexp
  2003-01-14 12:49 recursive query replace regexp Per Nordlöw
@ 2003-01-14 13:34 ` Christopher J. White
  2003-01-14 15:26 ` Kai Großjohann
  2003-01-14 21:15 ` kgold
  2 siblings, 0 replies; 4+ messages in thread
From: Christopher J. White @ 2003-01-14 13:34 UTC (permalink / raw)


>>>>> "per" == Per Nordlöw <per@foi.se> writes:

per> Is there any way to perform an interactive replace (query-replace) of
per> regular expressions recursively in all or some (specified by a regular
per> expression) files present in a directory tree.

Not sure what you mean by recursively, but if you just mean 
doing the equivalent of query-replace-regexp on mulitple
files, take a look at etags:

1) First make a 'TAGS' file to include the files you want (shell)

   $ etags `find . -name "*.blah.*.foo"`

   This makes a TAGS file in the current directory

2) In emacs, do M-x tags-query-replace.  It will query 
   for from-expression, to-expression, then the location
   of the TAGS file.

etags is extremely powerful for language specific
stuff, but works just fine for iterating over
a set of files.

...cj

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: recursive query replace regexp
  2003-01-14 12:49 recursive query replace regexp Per Nordlöw
  2003-01-14 13:34 ` Christopher J. White
@ 2003-01-14 15:26 ` Kai Großjohann
  2003-01-14 21:15 ` kgold
  2 siblings, 0 replies; 4+ messages in thread
From: Kai Großjohann @ 2003-01-14 15:26 UTC (permalink / raw)


"Per Nordlöw" <per@foi.se> writes:

> Is there any way to perform an interactive replace (query-replace) of
> regular expressions recursively in all or some (specified by a regular
> expression) files present in a directory tree.

In addition to TAGS files, another approach is M-x find-dired RET to
generate a dired buffer with the files, then invoke Q (not q).

You need (require 'dired-x) in ~/.emacs for Q to work.
-- 
Ambibibentists unite!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: recursive query replace regexp
  2003-01-14 12:49 recursive query replace regexp Per Nordlöw
  2003-01-14 13:34 ` Christopher J. White
  2003-01-14 15:26 ` Kai Großjohann
@ 2003-01-14 21:15 ` kgold
  2 siblings, 0 replies; 4+ messages in thread
From: kgold @ 2003-01-14 21:15 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 387 bytes --]


Edit the directory (emacs goes into dired mode), mark the files, and
use the Q command in dired.

"Per Nordlöw" <per@foi.se> writes:
> Is there any way to perform an interactive replace (query-replace) of
> regular expressions recursively in all or some (specified by a regular
> expression) files present in a directory tree.

-- 
-- 
Ken Goldman   kgold@watson.ibm.com   914-784-7646

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-01-14 21:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-14 12:49 recursive query replace regexp Per Nordlöw
2003-01-14 13:34 ` Christopher J. White
2003-01-14 15:26 ` Kai Großjohann
2003-01-14 21:15 ` kgold

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).