Function: read-kbd-macro
read-kbd-macro is an autoloaded, interactive and byte-compiled
function defined in edmacro.el.gz.
Signature
(read-kbd-macro START &optional END)
Documentation
Read the region as a keyboard macro definition.
The region between START and END is interpreted as spelled-out keystrokes,
e.g., "M-x abc RET". See documentation for edmacro-mode for details.
Leading/trailing "C-x (" and "C-x )" in the text are allowed and ignored.
The resulting macro is installed as the "current" keyboard macro.
In Lisp, may also be called with a single STRING argument in which case the result is returned rather than being installed as the current macro. The result is a vector of input events. Second argument NEED-VECTOR means to return an event vector always.
Probably introduced at or before Emacs version 28.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/edmacro.el.gz
;;;###autoload
(defun read-kbd-macro (start &optional end)
"Read the region as a keyboard macro definition.
The region between START and END is interpreted as spelled-out keystrokes,
e.g., \"M-x abc RET\". See documentation for `edmacro-mode' for details.
Leading/trailing \"C-x (\" and \"C-x )\" in the text are allowed and ignored.
The resulting macro is installed as the \"current\" keyboard macro.
In Lisp, may also be called with a single STRING argument in which case
the result is returned rather than being installed as the current macro.
The result is a vector of input events.
Second argument NEED-VECTOR means to return an event vector always."
(interactive "r")
(if (stringp start)
(edmacro-parse-keys start end)
(setq last-kbd-macro (edmacro-parse-keys (buffer-substring start end)))))