Function: kmacro-start-macro-or-insert-counter

Record subsequent keyboard input, defining a keyboard macro.
The commands are recorded even as they are executed.

Sets the `kmacro-counter' to ARG (or 0 if no prefix arg) before defining the
macro.

With C-u, appends to current keyboard macro (keeping
the current value of `kmacro-counter').

When defining/executing macro, inserts macro counter and increments
the counter with ARG or 1 if missing. With C-u,
inserts previous `kmacro-counter' (but do not modify counter).

The macro counter can be modified via M-x kmacro-set-counter and M-x kmacro-add-counter.
The format of the counter can be modified via M-x kmacro-set-format. (fn ARG)