]> git.eshelyaron.com Git - emacs.git/commitdiff
Make `C-x M-x insert-kbd-macro RET RET' work better
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 23 Jan 2022 15:48:42 +0000 (16:48 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 23 Jan 2022 15:48:42 +0000 (16:48 +0100)
* lisp/macros.el (insert-kbd-macro): Don't give bogus output on
names that have no function definition (bug#30309).

lisp/macros.el

index 4cb4e98d3fdbf7a089d4420dedd3bc3bac635c38..35d34d2e337d2569a7f096efb469433eded2605c 100644 (file)
@@ -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 ")