From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Jay Bingham" Newsgroups: gmane.emacs.help Subject: RE: replace a textblock in multiple files Date: Tue, 26 Sep 2006 19:45:57 GMT Message-ID: <20060926.124613.3420.891714@webmail58.nyc.untd.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1159355967 8318 80.91.229.2 (27 Sep 2006 11:19:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 27 Sep 2006 11:19:27 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 27 13:19:23 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GSXPw-0000Ub-7z for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Sep 2006 13:17:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GSXPv-0006GJ-DD for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Sep 2006 07:17:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GSIt7-0006uj-7o for help-gnu-emacs@gnu.org; Tue, 26 Sep 2006 15:46:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GSIt2-0006r9-6i for help-gnu-emacs@gnu.org; Tue, 26 Sep 2006 15:46:40 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GSIt2-0006r2-06 for help-gnu-emacs@gnu.org; Tue, 26 Sep 2006 15:46:36 -0400 Original-Received: from [64.136.20.164] (helo=outbound-mail.nyc.untd.com) by monty-python.gnu.org with smtp (Exim 4.52) id 1GSIxj-0005og-ED for help-gnu-emacs@gnu.org; Tue, 26 Sep 2006 15:51:27 -0400 Original-Received: from webmail58.nyc.untd.com (webmail58.nyc.untd.com [10.141.27.198]) by smtpout02.nyc.untd.com with SMTP id AABCTVA6VAH7AQ7J for (sender ); Tue, 26 Sep 2006 12:46:27 -0700 (PDT) X-UNTD-OriginStamp: 9wMZ3l1+FG1mkmIQefRR9s6V37TnR7WxE9+XDiCDNa2fdiSTD/HliCG3JtH1imbc Original-Received: (from b.jc-emacs@netzero.net) by webmail58.nyc.untd.com (jqueuemail) id L28HNVAR; Tue, 26 Sep 2006 12:46:13 PDT Original-Received: from [15.235.153.106] by webmail58.nyc.untd.com with HTTP: Tue, 26 Sep 2006 19:45:57 GMT X-Originating-IP: [15.235.153.106] Original-To: help-gnu-emacs@gnu.org X-Mailer: Webmail Version 4.0 Content-Disposition: inline X-ContentStamp: 12:6:2590112075 X-MAIL-INFO: 1700e4ade1a0f0e15961a0b08db0b5a584294981a5f5648064f59581cdcd816581ad91 X-UNTD-Peer-Info: 10.141.27.198|webmail58.nyc.untd.com|webmail58.nyc.untd.com|b.jc-emacs@netzero.net X-Mailman-Approved-At: Wed, 27 Sep 2006 07:16:38 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:37670 Archived-At: On Tuesday, September 26, 2006 6:18 AM Christian wrote: > 1) i want to work on several subdirectories, not only in one > directory > 2) i want to replace blocks consisting of more > than one line. > is that possible at all > p.s. i know it's always possible with programming elisp. but > i want to know if it's possible with simple emacs commands Yes, it can be done. You did not say which version of Emacs you are = running, that might make a difference. That said here is how I would = do it if I were running version 21.3. Load the ibuffer.el package, load the dired-x.el package. The ibuffer.el package is available from: = www.shootybangbang.com/software/ibuffer.el The dired-x.el package is a part of Emacs but must be explicitly = loaded/enabled in your .emacs. Once you have these to packages active you can use the % g dired = command to locate the files that contain block of text you want to = replace. Then you can use the C-u F dired command to load the files. Once the files are loaded invoke ibuffer and use the / c command to = limit the view to files containing the block of text. Then use the t = command to mark all the files. Finally use the U command to replace = the block of text defined by a regular expression with the new text. There may be other ways to do this, but this is the easiest way that = I know of using simple emacs commands. Good Luck, __ J_) C_)ingham = _____________________________________________________________________ PrivatePhone - FREE telephone number & voicemail. A number so private, you can make it public. http://www.privatephone.com