|
From: | Colin S. Miller |
Subject: | Re: need help with editing multiple files in a directory |
Date: | Thu, 19 Jul 2007 23:49:24 +0100 |
User-agent: | Icedove 1.5.0.12 (X11/20070607) |
bittna@gmail.com wrote:
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? Also how do I loop through all the buffers using lisp and switch into each buffer and do something, then move to the next buffer? Thanks!!!
Bittna, The function (dired-get-marked-files) looks interesting. I don't speak lisp well, so this mightn't be the best way of doing things. (loop for fileName in (dired-get-marked-files) do (progn (find-file fileName) (bittna-lisp-expr))) or (loop for fileName in (dired-get-marked-files) do (let ((buff)) (progn (setq buff (find-file fileName)) (bittna-lisp-expr)) (kill-buffer buff))) I use XEmacs, rather than GNU Emacs, so YMMV. HTH, Colin S. Miller -- Replace the obvious in my email address with the first three letters of the hostname to reply.
[Prev in Thread] | Current Thread | [Next in Thread] |