News for hackers. Stuff that matters.
Re:Learn Emacs: Keyboard Macros by to3m on Thursday November 10, 2011 @01:38PM (#3221202)
The newest emacs keybindings should help sort this out. Use <F3> to make it easy. Might as well just go C-h k <F3> to see what it does, but the function name `kmacro-start-macro-or-insert-counter' might give you a clue.

Here's what I'd do for your example, starting in an empty buffer:

abcdefghijklm C-a C-SPC C-e C-w <F3> #define SPC C-y M-b C-f C-SPC C-e C-w SPC <F3> RET <F4>

Then press F4 until you reach `m'. (You may find that the sequence ends with `m' being 12.)

(NOTE you should totally use `enum' for this; your debugger may on occasion permit you to use the names when you are entering an expression, and you'll get sensible error messages in the event of a conflict. Unlikely in this case I suppose since nobody uses variables called `i' or `j'.)

There are no comments on this comment yet.