From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Thomas L Roche" Newsgroups: gmane.emacs.windows,gmane.emacs.help Subject: Re: isearch-rename-all-matching-filenames-in-tree? Date: Mon, 14 Oct 2002 19:09:44 -0400 Sender: help-emacs-windows-admin@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: main.gmane.org 1034637165 19626 80.91.224.249 (14 Oct 2002 23:12:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 14 Oct 2002 23:12:45 +0000 (UTC) Cc: Wojciech Komornicki Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 181EOB-00056J-00 for ; Tue, 15 Oct 2002 01:12:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 181EOX-0005F2-00; Mon, 14 Oct 2002 19:13:05 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 181EOA-0004lf-00 for help-emacs-windows@gnu.org; Mon, 14 Oct 2002 19:12:42 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 181ELV-0003en-00 for help-emacs-windows@gnu.org; Mon, 14 Oct 2002 19:09:59 -0400 Original-Received: from e34.co.us.ibm.com ([32.97.110.132]) by monty-python.gnu.org with esmtp (Exim 4.10) id 181ELT-0003O5-00; Mon, 14 Oct 2002 19:09:55 -0400 Original-Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.194.23]) by e34.co.us.ibm.com (8.12.2/8.12.2) with ESMTP id g9EN9l8h017940; Mon, 14 Oct 2002 19:09:47 -0400 Original-Received: from d03nm120.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.3/NCO/VER6.4) with ESMTP id g9EN9kcK056208; Mon, 14 Oct 2002 17:09:46 -0600 Original-To: help-gnu-emacs@gnu.org, help-emacs-windows@gnu.org X-Mailer: Lotus Notes Release 5.0.8 June 18, 2001 X-MIMETrack: Serialize by Router on D03NM120/03/M/IBM(Release 5.0.10 |March 22, 2002) at 10/14/2002 05:09:46 PM, Serialize complete at 10/14/2002 05:09:46 PM Errors-To: help-emacs-windows-admin@gnu.org X-BeenThere: help-emacs-windows@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Discussion forum for users of the GNU Emacs port to Windows List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.windows:984 gmane.emacs.help:2610 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2610 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 > 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) -- use right arrow to go past Action > h) Class -- 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!