I have recently defined a keyboard macro using C-x (
and C-x)
. I then gave the keyboard macro a name using M-x name-last-kbd-macro RET defined-kbd-macro
. And saved it to a file using M-x insert-kbd-macro
. When I used C-h f RET defined-kbd-macro
, under documentation it simply stated that it was a keyboard macro. Is there a way to include a doc string in fset
command?
Asked
Active
Viewed 51 times
3

Tian
- 288
- 1
- 8
1 Answers
4
As the Elisp manual describes, you can also put the documentation string into the function-documentation
property of the symbol of the macro.
Example:
(fset 'defined-kbd-macro
(kmacro-lambda-form [?I ? ?a ?m ? ?a ? ?m ?a ?c ?r ?o ?.] 0 "%d"))
(put 'defined-kbd-macro 'function-documentation "My own documentation.")

Tobias
- 33,167
- 1
- 37
- 77