all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mathias Dahl <brakjoller@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: need help with editing multiple files in a directory
Date: Fri, 20 Jul 2007 07:33:19 +0200	[thread overview]
Message-ID: <uhcnz8wrk.fsf@gmail.com> (raw)
In-Reply-To: 1184860347.592401.221020@22g2000hsm.googlegroups.com

bittna@gmail.com writes:

> Hello, I have multiple files in a directory that need a line added
> at a certain point in the file.  I wrote a lisp expression to do it,
> but I have to load the file, then run the command on the buffer, the
> save the file and I lose my place.  I used dired to do a find and
> replace on all of the files I needed, but how do I run my lisp
> expression on all of the files?

Pascal posted a good example of how to use lisp to do what you
want. Depending on what exactly it is that you want to do, I would
also suggest using keyboard macros, they are really useful for adhoc
manipulations. Find the files to work with in Dired, kill all other
lines, then record the macro having point on the first file, do all
manipulations you want to do, close the file, go to the next file and
stop macro recording. Then execute the macro for the rest of the
files. Works in many cases.

/Mathias

      parent reply	other threads:[~2007-07-20  5:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-19 15:52 need help with editing multiple files in a directory bittna
2007-07-19 16:24 ` Pascal Bourguignon
2007-07-19 20:55 ` Joel J. Adamson
2007-07-19 22:49 ` Colin S. Miller
2007-07-20  5:33 ` Mathias Dahl [this message]

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=uhcnz8wrk.fsf@gmail.com \
    --to=brakjoller@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.