help-emacs-windows
[Top][All Lists]
Advanced

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

Re: [h-e-w] Re: isearch-regexp-in-all-matching-files-in-tree?


From: Thomas L Roche
Subject: Re: [h-e-w] Re: isearch-regexp-in-all-matching-files-in-tree?
Date: Tue, 15 Oct 2002 12:54:03 -0400

Thomas L Roche Mon, 14 Oct 2002 14:18:59 -0400
>>>> Use case: I'm in a dired buffer in GNU Emacs 21.1.1 on w2k. I
>>>> want to _interactively_ search for the string 'GenericAction'
>>>> (and replace with 'ActionClass') in all files with names matching
>>>> '*.java' anywhere in the directory tree below the current
>>>> directory.

Dave Forrest 10/14/2002 02:37 PM
>>> Would the Operate/Query replace in marked files Q or
>>> dired-do-query-replace do what you need?

I replied
>> No, because it requires marking the matching files first, but if
>> there's a way to do that, I could (manually) chain the two
>> operations.

Bill Pringlemeir 10/15/2002 11:37 AM
> C-h f -> "dired-mark-files-regexp"

>    dired-mark-files-regexp is an interactive compiled Lisp function
>    in `dired'. (dired-mark-files-regexp REGEXP &optional
>    MARKER-CHAR)

>    Mark all files matching REGEXP for use in later commands. A
>    prefix argument means to unmark them instead. `.' and `..' are
>    never marked.

> REGEXP is an Emacs regexp, not a shell wildcard. Thus, use `\.o$'
> for object files--just `.o' will mark more than you might think.

Again, that only handles part of the use case, which I see having 3
main parts:

0 interactive search/replace for a string within

1 files with names matching another string

2 anywhere in the directory tree below the current directory

So dired-mark-files-regexp allows me to mark the files by name (1), and 
dired-do-query-replace-regexp does the interactive search/replace. But
only find-name-dired (or similar) seems to get me the files desired in
the entire directory tree. 

However that I still need to dired-mark-files-regexp, with '.*', in
order to mark all the files returned by find-name-dired! Is there a
way around that?




reply via email to

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