From 907bad07f25ca91e72ebb29a468c6b1b8b91fa49 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Tue, 21 Feb 2017 21:31:24 -0500 Subject: [PATCH] Find macro binding for symbol-bound macros too (Bug#6848) 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. --- lisp/macros.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/macros.el b/lisp/macros.el index c1348295eb7..fc65489fe65 100644 --- a/lisp/macros.el +++ b/lisp/macros.el @@ -140,8 +140,9 @@ use this command, and then save the file." (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)) -- 2.39.5