aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2017-02-21 21:31:24 -0500
committerNoam Postavsky2017-02-21 21:44:54 -0500
commit907bad07f25ca91e72ebb29a468c6b1b8b91fa49 (patch)
tree2fe7ea502e0c17b0670f5d68f6aa66b3e7a1a2bb
parent3f1cd957ff319ce4b2ae94d656c9c702fa9ce653 (diff)
downloademacs-907bad07f25ca91e72ebb29a468c6b1b8b91fa49.tar.gz
emacs-907bad07f25ca91e72ebb29a468c6b1b8b91fa49.zip
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.
-rw-r--r--lisp/macros.el5
1 files 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."
140 (prin1 definition (current-buffer)))) 140 (prin1 definition (current-buffer))))
141 (insert ")\n") 141 (insert ")\n")
142 (if keys 142 (if keys
143 (let ((keys (where-is-internal (symbol-function macroname) 143 (let ((keys (or (where-is-internal (symbol-function macroname)
144 '(keymap)))) 144 '(keymap))
145 (where-is-internal macroname '(keymap)))))
145 (while keys 146 (while keys
146 (insert "(global-set-key ") 147 (insert "(global-set-key ")
147 (prin1 (car keys) (current-buffer)) 148 (prin1 (car keys) (current-buffer))