[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: need help with editing multiple files in a directory
From: |
Mathias Dahl |
Subject: |
Re: need help with editing multiple files in a directory |
Date: |
Fri, 20 Jul 2007 07:33:19 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (windows-nt) |
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