unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* isearch-rename-all-matching-filenames-in-tree?
@ 2002-10-14 18:20 Thomas L Roche
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas L Roche @ 2002-10-14 18:20 UTC (permalink / raw)


Use case: I'm in a dired buffer in GNU Emacs 21.1.1 on w2k. I
want to _interactively_ rename any file

- in the tree below the current directory

- with name matching '*GenericAction*'

to '*ActionClass*', in the same directory.

How can I do this?

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

* Re: isearch-rename-all-matching-filenames-in-tree?
       [not found] <mailman.1034619680.5071.help-gnu-emacs@gnu.org>
@ 2002-10-14 20:04 ` Stefan Monnier <foo@acm.com>
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2002-10-14 20:04 UTC (permalink / raw)


>>>>> "Thomas" == Thomas L Roche <tlroche@us.ibm.com> writes:
> Use case: I'm in a dired buffer in GNU Emacs 21.1.1 on w2k. I
> want to _interactively_ rename any file
> - in the tree below the current directory
> - with name matching '*GenericAction*'
> to '*ActionClass*', in the same directory.

Try wdired, it's great for those kind of things.


        Stefan

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

* Re: isearch-rename-all-matching-filenames-in-tree?
@ 2002-10-14 23:09 Thomas L Roche
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas L Roche @ 2002-10-14 23:09 UTC (permalink / raw)
  Cc: Wojciech Komornicki

I wrote:
>> Use case: I'm in a dired buffer in GNU Emacs 21.1.1 on w2k. I
>> want to _interactively_ rename any file

>> - in the directory tree below the current directory

>> - with name matching '*GenericAction*'

>> to '*ActionClass*', in the same directory.

Stefan Monnier replied:
> Try wdired, it's great for those kind of things.

While it does appear to be a very nice tool (and I've already
installed it), it doesn't quite solve this use case, because
dired won't show all matching files in the tree (just in the
current directory). But

Wojciech Komornicki suggested:
> Here is what I do
>   1) Do a find-dired interactively with
>       M-x find-dired <RET>
>      When prompted for the args enter
>           -name \*GenericAction\*

which is the other part of the puzzle. (find-name-dired solves my
use case with slightly less typing.)

>      This will give you a listing of all the GenericAction files

>   2) Record a keyboard macro to do the following
>   a) C-SPC     -- set a mark at a file name
>   b) C-e       -- go to end of line
>   c) M-w       -- copy the region to the kill buffer
>   d) R         -- rename the file
>   e) C-y       -- yank back the name of the current file
>   f) C-r GenericAction -- this will place the cursor at the G of
>                   GenericAction
>   g) <right arrow> -- use right arrow to go past Action
>   h) Class <RET> -- to enter Class after Action and rename the file
>   i) n         -- go to the next file

>    3) Once you have this macro recorded, replay the macro with
>         C-u 9999 C-x e

> If you do not have more than 10000 files this is all the
> keysrokes you need.

However I definitely prefer 'wdired' to the macro approach.

Thanks all!






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

end of thread, other threads:[~2002-10-14 23:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1034619680.5071.help-gnu-emacs@gnu.org>
2002-10-14 20:04 ` isearch-rename-all-matching-filenames-in-tree? Stefan Monnier <foo@acm.com>
2002-10-14 23:09 isearch-rename-all-matching-filenames-in-tree? Thomas L Roche
  -- strict thread matches above, loose matches on Subject: below --
2002-10-14 18:20 isearch-rename-all-matching-filenames-in-tree? Thomas L Roche

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