unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Applying macro to lines which match regexp
@ 2008-10-15 19:21 Corey Foote
  0 siblings, 0 replies; 6+ messages in thread
From: Corey Foote @ 2008-10-15 19:21 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 919 bytes --]


I was reading through the Emacs manual today, and came across C-x C-k r (apply-macro-to-region-lines) which applies the last keyboard macro to each line that begins in the region. How would I apply the last keyboard macro to each line that begins in the region which match a certain regular expression. For example, say I was editing a Perl script and wanted to apply the last macro to all line which consist solely of a comment. For example:

1    # Print some text
2    print "foo";
3    print "foobar";
4
5    # And then a while later
6    print "foobarbaz";

I would want to apply the macro to lines 1 and 6 which match the regular expression ^\s-*#. Thanks a bunch!

Corey Foote
Toby Software
_________________________________________________________________
Stay up to date on your PC, the Web, and your mobile phone with Windows Live.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/

[-- Attachment #2: Type: text/html, Size: 1186 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-10-16  0:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1136.1224098481.25473.help-gnu-emacs@gnu.org>
2008-10-15 19:54 ` Applying macro to lines which match regexp Xah
2008-10-15 21:16   ` Xah
2008-10-15 23:09     ` Parker, Matthew
2008-10-15 23:36 ` Andreas Politz
2008-10-16  0:38 ` Tim X
2008-10-15 19:21 Corey Foote

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).