]> git.eshelyaron.com Git - emacs.git/commitdiff
Find macro binding for symbol-bound macros too (Bug#6848)
authorNoam Postavsky <npostavs@gmail.com>
Wed, 22 Feb 2017 02:31:24 +0000 (21:31 -0500)
committerNoam Postavsky <npostavs@gmail.com>
Wed, 22 Feb 2017 02:44:54 +0000 (21:44 -0500)
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

index c1348295eb74aefa786e7345b091767497380a65..fc65489fe658fb71589c9034f8e3df331090467a 100644 (file)
@@ -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))