kmacro-end-and-call-macro

kmacro-end-and-call-macro is an interactive autoloaded compiled Lisp function in `kmacro.el'.

It is bound to C-x e.

(kmacro-end-and-call-macro ARG &optional NO-REPEAT)

Call last keyboard macro, ending it first if currently being defined.
With numeric prefix ARG, repeat macro that many times.
Zero argument means repeat until there is an error.

To give a macro a permanent name, so you can call it
even after defining other macros, use C-x C-k n.