From a82c3557fc49a5c4f0f71f769daf778770597b95 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 23 Jan 2022 16:48:42 +0100 Subject: [PATCH] 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). --- lisp/macros.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 ") -- 2.39.5