unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* keyboard macro question
@ 2009-10-02 14:05 Benjamin
  2009-10-02 14:15 ` Joost Kremers
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Benjamin @ 2009-10-02 14:05 UTC (permalink / raw)
  To: help-gnu-emacs

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:

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


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

end of thread, other threads:[~2009-11-13 18:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-02 14:05 keyboard macro question Benjamin
2009-10-02 14:15 ` Joost Kremers
2009-10-02 14:34 ` David Kastrup
2009-10-02 14:54   ` jbenjam
2009-10-02 14:50 ` Colin S. Miller
2009-10-02 18:12   ` Harry Putnam
2009-10-02 20:15     ` Tassilo Horn
2009-10-03  2:04 ` Eric
     [not found] ` <d9407676-bb83-46a4-9804-0450cc190b59@v37g2000prg.googlegroups.com>
2009-10-18  1:46   ` David Combs
2009-10-18 17:40     ` Xah Lee
2009-11-12  3:12       ` David Combs
2009-11-13 18:36         ` Lars Enderin

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