help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apply macro to region


From: Marc Tfardy
Subject: Re: Apply macro to region
Date: Fri, 22 Jul 2005 11:06:41 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Kevin Rodgers schrieb:
Marc Tfardy wrote:
 > I have a set of named macros. With apply-macro-to-region-lines command
 > I can apply last defined macro to each line of region. How can
 > I apply a named macro to region, except I define a "wrapper macro"
 > with C-x ( macro name C-x )? Any ideas?

Advise it to read a macro name (when preceded by C-u):

(defadvice apply-macro-to-region-lines (before read-named-macro activate)
"With a prefix arg, read a named macro to apply (instead of the last macro)."
  (interactive
   (list (region-beginning)
         (region-end)
         (if current-prefix-arg
             (read-command "Name of keyboard macro to apply: ")))))

BTW, frequent users of apply-macro-to-region-lines might like this:
(global-set-key "\C-xE" 'apply-macro-to-region-lines)

It works! Thanks a lot!

regards

Marc





reply via email to

[Prev in Thread] Current Thread [Next in Thread]