From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Dalton, Barnaby" Newsgroups: gmane.emacs.help,gmane.emacs.windows Subject: RE: [h-e-w] Re: isearch-regexp-in-all-matching-files-in-tree? Date: Tue, 15 Oct 2002 09:21:03 +0100 Sender: help-gnu-emacs-admin@gnu.org Message-ID: <3190BC9FA8F6D3119508009027E5B33E9D575F@MORSE> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: main.gmane.org 1034669995 14195 80.91.224.249 (15 Oct 2002 08:19:55 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 15 Oct 2002 08:19:55 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, help-emacs-windows@gnu.org 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 181Mvh-0003gp-00 for ; Tue, 15 Oct 2002 10:19:54 +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 181MuR-0007an-00; Tue, 15 Oct 2002 04:18:35 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 181Mt3-0007Em-00 for help-gnu-emacs@gnu.org; Tue, 15 Oct 2002 04:17:09 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 181Msx-0007Cp-00 for help-gnu-emacs@gnu.org; Tue, 15 Oct 2002 04:17:07 -0400 Original-Received: from mail.radioscape.com ([193.122.23.66] helo=mimesweeper.radioscape.com) by monty-python.gnu.org with esmtp (Exim 4.10) id 181Msu-0007AC-00; Tue, 15 Oct 2002 04:17:00 -0400 Original-Received: from euler.radioscape.com (unverified) by mimesweeper.radioscape.com (Content Technologies SMTPRS 4.2.10) with ESMTP id ; Tue, 15 Oct 2002 09:14:33 +0100 Original-Received: by EULER with Internet Mail Service (5.5.2653.19) id ; Tue, 15 Oct 2002 09:05:27 +0100 Original-To: 'Thomas L Roche' , David Forrest X-Mailer: Internet Mail Service (5.5.2653.19) Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:2625 gmane.emacs.windows:992 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2625 To rename files I use a perl script 'rename' from the perl cookbook http://www.linuxchix.org/pipermail/techtalk/2001-October/012104.html To replace stuff in files have a look at http://www.emacswiki.org/cgi-bin/wiki.pl?SearchAndReplaceAcrossMultipleFiles . I use grep-x which does what you asked with the grep buffer but there are other options documented here as well. Barney > -----Original Message----- > From: Thomas L Roche [mailto:tlroche@us.ibm.com] > Sent: 14 October 2002 7:56 PM > To: David Forrest > Cc: help-gnu-emacs@gnu.org; help-emacs-windows@gnu.org > Subject: [h-e-w] Re: isearch-regexp-in-all-matching-files-in-tree? > > > On Mon, 14 Oct 2002, Tom Roche wrote: > >> 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? > > 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. > > Alternatively, is there a way that I could query-replace-regexp > on a grep-mode buffer, instead of a dired buffer? I'd be happy if > I could > > M-x grep-find RET > > find . -type f -print0 -name '*.java'| xargs -0 -e grep -n -e > 'GenericAction' | grep -v 'EGLGenericAction' | grep -v > 'GenericActionModel' | grep -v 'GenericActionCodeGenContrib' RET > > Q RET > > GenericAction RET > > ActionClass RET > > ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify postmaster@radioscape.com. This footnote also confirms that this email message has been scanned for the presence of computer viruses known at the time of sending. www.radioscape.com **********************************************************************