Function: defining-kbd-macro

Record subsequent keyboard input, defining a keyboard macro.
The commands are recorded even as they are executed.
Use M-x end-kbd-macro to finish recording and make the macro available.
Use M-x name-last-kbd-macro to give it a permanent name.
Non-nil arg (prefix arg) means append to last macro defined;
this begins by re-executing that macro as if you typed it again.
If optional second arg, NO-EXEC, is non-nil, do not re-execute last
macro before appending to it.
(fn APPEND &optional NO-EXEC)

Variable: defining-kbd-macro

Non-nil while a keyboard macro is being defined. Don't set this!
The value is the symbol `append' while appending to the definition of
an existing macro.