From: Lars Ingebrigtsen Date: Sun, 23 Jan 2022 15:48:42 +0000 (+0100) Subject: Make `C-x M-x insert-kbd-macro RET RET' work better X-Git-Tag: emacs-29.0.90~2830 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a82c3557fc49a5c4f0f71f769daf778770597b95;p=emacs.git Make `C-x M-x insert-kbd-macro RET RET' work better * lisp/macros.el (insert-kbd-macro): Don't give bogus output on names that have no function definition (bug#30309). --- diff --git a/lisp/macros.el b/lisp/macros.el index 4cb4e98d3fd..35d34d2e337 100644 --- a/lisp/macros.el +++ b/lisp/macros.el @@ -134,8 +134,9 @@ use this command, and then save the file." (_ (prin1 definition (current-buffer)))))) (insert ")\n") (if keys - (let ((keys (or (where-is-internal (symbol-function macroname) - '(keymap)) + (let ((keys (or (and (symbol-function macroname) + (where-is-internal (symbol-function macroname) + '(keymap))) (where-is-internal macroname '(keymap))))) (while keys (insert "(global-set-key ")