3

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?

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.")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.