From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: zeek peters Newsgroups: gmane.emacs.help Subject: Macros in dired - Is it possible? Date: Fri, 17 Jul 2009 11:41:24 -0700 Message-ID: <2c6aec20907171141j3b26d6b3v9e6d89b65e43f54@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016e649cfaca686d5046eeb226b X-Trace: ger.gmane.org 1247897031 22147 80.91.229.12 (18 Jul 2009 06:03:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Jul 2009 06:03:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jul 18 08:03:44 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MS31L-00034g-UN for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Jul 2009 08:03:44 +0200 Original-Received: from localhost ([127.0.0.1]:52634 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MS31L-0007Vz-Gq for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Jul 2009 02:03:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MRsN9-00046O-OV for help-gnu-emacs@gnu.org; Fri, 17 Jul 2009 14:41:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MRsN5-00041n-N6 for help-gnu-emacs@gnu.org; Fri, 17 Jul 2009 14:41:31 -0400 Original-Received: from [199.232.76.173] (port=59365 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MRsN5-00041T-HH for help-gnu-emacs@gnu.org; Fri, 17 Jul 2009 14:41:27 -0400 Original-Received: from mail-fx0-f215.google.com ([209.85.220.215]:54384) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MRsN4-00063u-UZ for help-gnu-emacs@gnu.org; Fri, 17 Jul 2009 14:41:27 -0400 Original-Received: by fxm11 with SMTP id 11so67359fxm.42 for ; Fri, 17 Jul 2009 11:41:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=2YHCdDhuI4KVbaKdlyRmrpGUY9ag4/d+IzjJBP+GciI=; b=Q8cEdyw4nGRhASiEEA9XtWBLMblIpv7Vn/uMC4OcY8UKxdP6drNb1ZW/9YIiiBHiRt eQxBO0VPte6u0gZU53oe3jQbMSIyAAc1BXA18ExCa13LMmey8LBGSitjMbzEH+RK53Xa 9uU6cLC/yorS++vOQZkTqdZNpTIdSqN4GBkWY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=iJpmff9xse1K2JukTYzOXkNMNxy8wbdA5pwv+RgSUJQVDCcfBe86X59uTWvfB/4162 Fp05On2NNk/2rLsuImE0ceLhyw1mHu8CQauZ+yiXg+11tRO/VfDssfEvaOgTC3N1uFl5 cHUqkYgJjoZoyXlg+NhH2+yFIDuzdPVJZaTUk= Original-Received: by 10.102.247.4 with SMTP id u4mr740698muh.26.1247856084551; Fri, 17 Jul 2009 11:41:24 -0700 (PDT) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Sat, 18 Jul 2009 02:00:36 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:66195 Archived-At: --0016e649cfaca686d5046eeb226b Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit [ *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 --0016e649cfaca686d5046eeb226b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable [ *Question* ]
Is it possible to mark files in dired and then run a macr= o 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
r= un 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 separ= ate
buffers.
2. Then tried creating another macro that calls the firs= t macro,
and also saves the edited and much smaller file, and then kills= the buffer
3.=A0 So, for 10 files, I would call macro2 via [ ^u 10 Mx macro2 ]
4. T= he problem, I am having is that the 2nd macro doesn't record
the sav= e 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 t= ry again, the 2nd macro calls macro1 to do its magic, but
the modificati= ons aren't saved, nor is the buffer killed. So,
only one of the 10 f= iles 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, readin= g the both manuals ( emacs
and Lisp how2 ).=A0

I'm looking f= orward to learning more, but starting to get a bit
frustated. Hope you could offer some insight/assistance. Thanks

[ *I= nfo* ]
emacs-snapshot ( GNU Emacs 23.0.95.1 (i486-pc-linux-gnu, GTK+Version 2.16.4) of 2009-07-03
--0016e649cfaca686d5046eeb226b--