There are 2 ways to bind a macro: with global-set-key or
kmacro-bind-to-key. The former binds a key to a symbol, while the
latter binds to a lambda. In 2010-03-03 "Fix keyboard macro key
lookup (Bug#5481)", `insert-kbd-macro' was fixed to detect the lambda
case, but broke the symbol case.
* lisp/macros.el (insert-kbd-macro): Also check for bindings of
MACRONAME.
(prin1 definition (current-buffer))))
(insert ")\n")
(if keys
- (let ((keys (where-is-internal (symbol-function macroname)
- '(keymap))))
+ (let ((keys (or (where-is-internal (symbol-function macroname)
+ '(keymap))
+ (where-is-internal macroname '(keymap)))))
(while keys
(insert "(global-set-key ")
(prin1 (car keys) (current-buffer))