unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* apply macro to region lines by name
@ 2010-07-05 18:37 Corey Foote
  2010-07-05 19:28 ` Peter Dyballa
  0 siblings, 1 reply; 8+ messages in thread
From: Corey Foote @ 2010-07-05 18:37 UTC (permalink / raw)
  To: help-gnu-emacs

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


Hello,

I created a macro and named it 'foo.' How do I call this macro by name when I want to apply it to a number of lines, somewhat like when you use M-x apply-macro-to-region-lines, but only I want to be able to tell it to use 'foo,' and not just have it use the last macro defined. Thanks!
 		 	   		  
_________________________________________________________________
Hotmail is redefining busy with tools for the New Busy. Get more from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2

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

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

* Re: apply macro to region lines by name
  2010-07-05 18:37 apply macro to region lines by name Corey Foote
@ 2010-07-05 19:28 ` Peter Dyballa
  2010-07-05 19:33   ` Suvayu Ali
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Dyballa @ 2010-07-05 19:28 UTC (permalink / raw)
  To: Corey Foote; +Cc: help-gnu-emacs


Am 05.07.2010 um 20:37 schrieb Corey Foote:

> I want to apply it to a number of lines


Mark these lines, then apply the macro on this region.

--
Greetings

   Pete

For some reason, this fortune reminds everyone of Marvin Zelkowitz.




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

* Re: apply macro to region lines by name
  2010-07-05 19:28 ` Peter Dyballa
@ 2010-07-05 19:33   ` Suvayu Ali
  2010-07-06  1:17     ` Corey Foote
  0 siblings, 1 reply; 8+ messages in thread
From: Suvayu Ali @ 2010-07-05 19:33 UTC (permalink / raw)
  To: help-gnu-emacs

On Monday 05 July 2010 12:28 PM, Peter Dyballa wrote:
>
> Am 05.07.2010 um 20:37 schrieb Corey Foote:
>
>> I want to apply it to a number of lines
>
>
> Mark these lines, then apply the macro on this region.
>

`M-x foo'

-- 
Suvayu

Open source is the future. It sets us free.



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

* RE: apply macro to region lines by name
  2010-07-05 19:33   ` Suvayu Ali
@ 2010-07-06  1:17     ` Corey Foote
  2010-07-06  2:40       ` Suvayu Ali
  0 siblings, 1 reply; 8+ messages in thread
From: Corey Foote @ 2010-07-06  1:17 UTC (permalink / raw)
  To: fatkasuvayu+linux, help-gnu-emacs

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


Thanks, but that only applies the macro to the last line of the region. I want it to apply it to every line within the region.

> Date: Mon, 5 Jul 2010 12:33:12 -0700
> From: fatkasuvayu+linux@gmail.com
> To: help-gnu-emacs@gnu.org
> Subject: Re: apply macro to region lines by name
> 
> On Monday 05 July 2010 12:28 PM, Peter Dyballa wrote:
> >
> > Am 05.07.2010 um 20:37 schrieb Corey Foote:
> >
> >> I want to apply it to a number of lines
> >
> >
> > Mark these lines, then apply the macro on this region.
> >
> 
> `M-x foo'
> 
> -- 
> Suvayu
> 
> Open source is the future. It sets us free.
> 
 		 	   		  
_________________________________________________________________
Hotmail is redefining busy with tools for the New Busy. Get more from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2

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

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

* Re: apply macro to region lines by name
  2010-07-06  1:17     ` Corey Foote
@ 2010-07-06  2:40       ` Suvayu Ali
  2010-07-06  2:47         ` Pranav Peshwe
  0 siblings, 1 reply; 8+ messages in thread
From: Suvayu Ali @ 2010-07-06  2:40 UTC (permalink / raw)
  To: Corey Foote; +Cc: help-gnu-emacs

On Monday 05 July 2010 06:17 PM, Corey Foote wrote:
>
> Thanks, but that only applies the macro to the last line of the region. I want it to apply it to every line within the region.
>

How about you mark the region, then `M-='. This runs 
`count-lines-region'. And then run `M-<no_of_lines> M-x foo'

Its not very clean but that should do it.

-- 
Suvayu

Open source is the future. It sets us free.



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

* Re: apply macro to region lines by name
  2010-07-06  2:40       ` Suvayu Ali
@ 2010-07-06  2:47         ` Pranav Peshwe
  2010-07-06  2:52           ` Suvayu Ali
  0 siblings, 1 reply; 8+ messages in thread
From: Pranav Peshwe @ 2010-07-06  2:47 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: help-gnu-emacs

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

On Tue, Jul 6, 2010 at 8:10 AM, Suvayu Ali
<fatkasuvayu+linux@gmail.com<fatkasuvayu%2Blinux@gmail.com>
> wrote:

> On Monday 05 July 2010 06:17 PM, Corey Foote wrote:
>
>>
>> Thanks, but that only applies the macro to the last line of the region. I
>> want it to apply it to every line within the region.
>>
>>
> How about you mark the region, then `M-='. This runs `count-lines-region'.
> And then run `M-<no_of_lines> M-x foo'
>
> Its not very clean but that should do it.
>
>
That will work fine provided that the macro itself contains a command to
move to the next/previous line. Otherwise the same action will be done n
times on the one line the macro was run on.

HTH.

-Pranav


> --
> Suvayu
>
> Open source is the future. It sets us free.
>
>

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

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

* Re: apply macro to region lines by name
  2010-07-06  2:47         ` Pranav Peshwe
@ 2010-07-06  2:52           ` Suvayu Ali
  2010-07-06  2:57             ` Pranav Peshwe
  0 siblings, 1 reply; 8+ messages in thread
From: Suvayu Ali @ 2010-07-06  2:52 UTC (permalink / raw)
  To: Pranav Peshwe; +Cc: help-gnu-emacs

On Monday 05 July 2010 07:47 PM, Pranav Peshwe wrote:
> That will work fine provided that the macro itself contains a command to
> move to the next/previous line. Otherwise the same action will be done n
> times on the one line the macro was run on.

Isn't that one of the first things we learn when we learnt how to record 
a keyboard macro?

"Always make sure after the macro is done, we end up in a position so 
that the entire thing can be repeated again."

-- 
Suvayu

Open source is the future. It sets us free.



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

* Re: apply macro to region lines by name
  2010-07-06  2:52           ` Suvayu Ali
@ 2010-07-06  2:57             ` Pranav Peshwe
  0 siblings, 0 replies; 8+ messages in thread
From: Pranav Peshwe @ 2010-07-06  2:57 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: help-gnu-emacs

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

On Tue, Jul 6, 2010 at 8:22 AM, Suvayu Ali
<fatkasuvayu+linux@gmail.com<fatkasuvayu%2Blinux@gmail.com>
> wrote:

> On Monday 05 July 2010 07:47 PM, Pranav Peshwe wrote:
>
>> That will work fine provided that the macro itself contains a command to
>> move to the next/previous line. Otherwise the same action will be done n
>> times on the one line the macro was run on.
>>
>
> Isn't that one of the first things we learn when we learnt how to record a
> keyboard macro?
>
> "Always make sure after the macro is done, we end up in a position so that
> the entire thing can be repeated again."
>
>
True.

- P


> --
> Suvayu
>
> Open source is the future. It sets us free.
>

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

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

end of thread, other threads:[~2010-07-06  2:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-05 18:37 apply macro to region lines by name Corey Foote
2010-07-05 19:28 ` Peter Dyballa
2010-07-05 19:33   ` Suvayu Ali
2010-07-06  1:17     ` Corey Foote
2010-07-06  2:40       ` Suvayu Ali
2010-07-06  2:47         ` Pranav Peshwe
2010-07-06  2:52           ` Suvayu Ali
2010-07-06  2:57             ` Pranav Peshwe

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