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: Kevin Rodgers
Subject: Re: Apply macro to region
Date: Thu, 21 Jul 2005 17:08:23 -0600
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

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)

--
Kevin Rodgers





reply via email to

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