From: zeek peters <zp1zp11@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Macros in dired - Is it possible?
Date: Fri, 17 Jul 2009 11:41:24 -0700 [thread overview]
Message-ID: <2c6aec20907171141j3b26d6b3v9e6d89b65e43f54@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1637 bytes --]
[ *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 23.0.95.1 (i486-pc-linux-gnu, GTK+
Version 2.16.4) of 2009-07-03
[-- Attachment #2: Type: text/html, Size: 1785 bytes --]
next reply other threads:[~2009-07-17 18:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-17 18:41 zeek peters [this message]
[not found] <mailman.2744.1247896840.2239.help-gnu-emacs@gnu.org>
2009-07-18 9:14 ` Macros in dired - Is it possible? Xah Lee
2009-07-18 17:19 ` zeek
2009-07-18 21:10 ` Anselm Helbig
2009-07-18 21:02 ` muede
2009-07-18 21:08 ` Anselm Helbig
2009-07-19 2:29 ` zeek
2009-07-19 16:04 ` Xah Lee
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2c6aec20907171141j3b26d6b3v9e6d89b65e43f54@mail.gmail.com \
--to=zp1zp11@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).