[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: keyboard macro question
From: |
Eric |
Subject: |
Re: keyboard macro question |
Date: |
Fri, 2 Oct 2009 19:04:06 -0700 (PDT) |
User-agent: |
G2/1.0 |
On Oct 2, 10:05 pm, Benjamin <jben...@gmail.com> wrote:
> I use keyboard macros fairly frequently, but I often run into a
> situation where I would like to increment a number in the macro, e.g.,
> if I start with:
Keyboard Macro Counters! That's what they're there for:
http://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macro-Counter.html
Eric
>
> tmp tmp tmp tmp
>
> and I want to end with:
> tmp1
> tmp2
> tmp3
> tmp4
>
> I know how to create the macro where it would result in:
> tmp1
> tmp1
> tmp1
> tmp1
>
> Is there a way to make the number increment each time the macro is
> executed?
> Otherwise I am forced to step down through each line and manually put
> the numbers in 1, 2, 3, 4, ...
> Naturally this is a greatly shortened example for illustration
> purposes, and often the incrementing takes place within a longer
> statement e.g., tmp(:,1) = function(x,y). My interest here is how to
> increment or decrement the number in a more automatic fashion.
>
> I don't mind doing something other than macros, or even external
> commands (perl/sed/awk, etc.)
> to assist with this.
>
> Thanks,
> -Ben