will bind the last keyboard macro to the key sequence @kbd{C-x C-k 4}.
@findex insert-kbd-macro
- Once a macro has a command name, you can save its definition in a file.
-Then it can be used in another editing session. First, visit the file
-you want to save the definition in. Then use this command:
+ You can save a macro's definition in a file. Then it can be used in
+another editing session. First, visit the file you want to save the
+definition in. Then use this command:
@example
M-x insert-kbd-macro @key{RET} @var{macroname} @key{RET}
to @var{macroname}, so that the macro will be reassigned the same keys
when you load the file.
+ If you do not give @code{insert-kbd-macro} a macro name, it will
+insert Lisp code to restore the @code{last-kdb-macro}.
+
@node Edit Keyboard Macro
@section Editing a Keyboard Macro
;;;###autoload
(defun insert-kbd-macro (macroname &optional keys)
"Insert in buffer the definition of kbd macro MACRONAME, as Lisp code.
-MACRONAME should be a symbol.
+MACRONAME should be a symbol; if none is given, the function inserts
+the definition of `last-kdb-macro'.
Optional second arg KEYS means also record the keys it is on
\(this is the prefix argument, when calling interactively).