[ *Question* ] Is it possible to mark files in dired and then run a macro on all the selected files?
[ *Background* ] The macro finds and deletes certain portions/paragraphs from text files to cut them down in size so that I can read them easier and quicker.
But I am getting tired of loading one file at a time into Emacs to run the macro ( via ^u 0 MX macro1 ). I do this about 100x/day. So is there a quicker/better way to run a macro en mass?
[ *What I Have Tried, but Hasn't Worked* ]
As an example 1. I load 10 text files into emacs, thus creating 10 separate buffers. 2. Then tried creating another macro that calls the first macro, and also saves the edited and much smaller file, and then kills the buffer
3. So, for 10 files, I would call macro2 via [ ^u 10 Mx macro2 ] 4. The problem, I am having is that the 2nd macro doesn't record the save or the kill. So, I tried to edit the saved macro2 via [ Mx edit-named-k TAB RET macro2 ]. I add the commands [ ^x ^s ]
and [ ^x k RET ], and do a [ c ^c ]. The changes are saved, but when I try again, the 2nd macro calls macro1 to do its magic, but the modifications aren't saved, nor is the buffer killed. So, only one of the 10 files files has been modified.
[ *What I have learned* ] A lot, since I am a completely new to this. Learned a little bit about Git, compiling, Org-mode. Currently, reading the both manuals ( emacs and Lisp how2 ).
I'm looking forward to learning more, but starting to get a bit
frustated. Hope you could offer some insight/assistance. Thanks
[ *Info* ] emacs-snapshot ( GNU Emacs 220.127.116.11 (i486-pc-linux-gnu, GTK+ Version 2.16.4) of 2009-07-03