all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Jay Bingham" <b.jc-emacs@netzero.net>
Subject: RE: replace a textblock in multiple files
Date: Tue, 26 Sep 2006 19:45:57 GMT	[thread overview]
Message-ID: <20060926.124613.3420.891714@webmail58.nyc.untd.com> (raw)

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

             reply	other threads:[~2006-09-26 19:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-26 19:45 Jay Bingham [this message]
     [not found] <mailman.7384.1159203371.9609.help-gnu-emacs@gnu.org>
2006-09-26  0:52 ` replace a textblock in multiple files Benjamin Rutt
  -- strict thread matches above, loose matches on Subject: below --
2006-09-25 16:55 C.Strobl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060926.124613.3420.891714@webmail58.nyc.untd.com \
    --to=b.jc-emacs@netzero.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.