Marc Ihm <m...@ihm.name> writes: > (global-set-key (kbd "<f12>") (lambda () (interactive) (execute-kbd-macro > (kbd "C-c a v"))))
(global-set-key (kbd "<f12>") (kbd "C-c a v")) might be a little easier to read and type. Explanation is : global-set-key can take any "command" as argument, and the definition of what a "command" is includes keyboard macros. That is vaguely explained at (info "(elisp) What Is a Function") -- 2nd paragraph after the term "command". > P.s.: In my opinion, the name "execute-kbd-macro" of this builtin function is > somewhat misleading; > "replay-keys" describes this usage closer ... I think I wouldn't look for replay-keys if I did not know about the function. My own problem is that I usually look for "call-kbd-macro", which doesn't exist, instead of "execute-...". I guess everyone can't be pleased ! -- Nico.