F3
, C-x (
: Start defining a macro.F4
, C-x )
: Stop defining a macro.F4
, C-x e
: Execute a macroC-u 42 C-x e
: Execute a macro 42 times, using prefix argumentC-u 0 C-x e
: Execute a macro until an error occurs, i.e. the end
of the buffer. Also M-0 C-x e
, or M-0 F4
.C-x C-k r
: (apply-macro-to-lines
) Apply macro to every line in
the region.See also Emacs Manual