Subject: Surprising behaviour of insert-kbd-macro

From: Robert Pluim <[email-masked]>
Date: Wed, 31 Jan 2018 17:26:53 +0100

#emacs-26
emacs -Q
C-u M-x insert-kbd-macro RET RET
=>
(setq last-kbd-macro
   nil)
(global-set-key [C-down-mouse-2 s2] 'last-kbd-macro)
(global-set-key [C-down-mouse-2 s1] 'last-kbd-macro)
(global-set-key [menu-bar help-menu sep1] 'last-kbd-macro)
(global-set-key [menu-bar help-menu sep2] 'last-kbd-macro)
(global-set-key [menu-bar help-menu sep4] 'last-kbd-macro)
(global-set-key [menu-bar file separator-save] 'last-kbd-macro)
(global-set-key [menu-bar file separator-print] 'last-kbd-macro)
(global-set-key [menu-bar file separator-window] 'last-kbd-macro)
(global-set-key [menu-bar file separator-frame] 'last-kbd-macro)
(global-set-key [menu-bar file separator-exit] 'last-kbd-macro)
(global-set-key [menu-bar edit separator-search] 'last-kbd-macro)
(global-set-key [menu-bar edit separator-bookmark] 'last-kbd-macro)
(global-set-key [menu-bar options highlight-separator] 'last-kbd-macro)
(global-set-key [menu-bar options edit-options-separator] 'last-kbd-macro)
(global-set-key [menu-bar options cursor-separator] 'last-kbd-macro)
(global-set-key [menu-bar options debugger-separator] 'last-kbd-macro)
(global-set-key [menu-bar options mule-separator] 'last-kbd-macro)
(global-set-key [menu-bar options showhide-separator] 'last-kbd-macro)
(global-set-key [menu-bar options custom-separator] 'last-kbd-macro)
(global-set-key [menu-bar buffer command-separator] 'last-kbd-macro)
(global-set-key [menu-bar tools separator-prog] 'last-kbd-macro)
(global-set-key [menu-bar tools separator-spell] 'last-kbd-macro)
(global-set-key [menu-bar tools separator-compare] 'last-kbd-macro)
(global-set-key [menu-bar tools separator-vc] 'last-kbd-macro)
(global-set-key [menu-bar tools separator-net] 'last-kbd-macro)
(global-set-key [menu-bar tools separator-encryption-decryption] 'last-kbd-macro)
(global-set-key [menu-bar tools separator-games] 'last-kbd-macro)
(global-set-key [menu-bar help-menu search-documentation sep1] 'last-kbd-macro)
(global-set-key [menu-bar help-menu describe separator-desc-mule] 'last-kbd-macro)
(global-set-key [menu-bar help-menu more-manuals sep2] 'last-kbd-macro)
(global-set-key [menu-bar edit search separator-repeat-search] 'last-kbd-macro)
(global-set-key [menu-bar edit search separator-tag-search] 'last-kbd-macro)
(global-set-key [menu-bar edit search separator-tag-isearch] 'last-kbd-macro)
(global-set-key [menu-bar edit replace separator-replace-tags] 'last-kbd-macro)
(global-set-key [menu-bar edit goto separator-xref] 'last-kbd-macro)
(global-set-key [menu-bar edit goto separator-tag-file] 'last-kbd-macro)
(global-set-key [menu-bar edit props s2] 'last-kbd-macro)
(global-set-key [menu-bar edit props s1] 'last-kbd-macro)
(global-set-key [menu-bar options search-options custom-separator] 'last-kbd-macro)
(global-set-key [menu-bar options mule separator-mule] 'last-kbd-macro)
(global-set-key [menu-bar options mule separator-input-method] 'last-kbd-macro)
(global-set-key [menu-bar options mule separator-coding-system] 'last-kbd-macro)
(global-set-key [menu-bar options showhide datetime-separator] 'last-kbd-macro)
(global-set-key [menu-bar options showhide linecolumn-separator] 'last-kbd-macro)
(global-set-key [menu-bar options customize separator-3] 'last-kbd-macro)
(global-set-key [menu-bar options customize separator-2] 'last-kbd-macro)
(global-set-key [menu-bar options customize separator-1] 'last-kbd-macro)
(global-set-key [menu-bar tools compare separator-ediff-files] 'last-kbd-macro)
(global-set-key [menu-bar tools compare separator-ediff-directories] 'last-kbd-macro)
(global-set-key [menu-bar tools compare separator-ediff-regions] 'last-kbd-macro)
(global-set-key [menu-bar tools compare separator-ediff-windows] 'last-kbd-macro)
(global-set-key [menu-bar tools compare separator-ediff-misc] 'last-kbd-macro)
(global-set-key [menu-bar tools ediff-merge separator-ediff-merge-dirs] 'last-kbd-macro)
(global-set-key [menu-bar tools ediff-merge separator-ediff-merge] 'last-kbd-macro)
(global-set-key [menu-bar tools vc separator2] 'last-kbd-macro)
(global-set-key [menu-bar tools vc separator1] 'last-kbd-macro)
(global-set-key [menu-bar tools directory-search separator-eudc-query] 'last-kbd-macro)
(global-set-key [menu-bar tools directory-search separator-eudc-email] 'last-kbd-macro)
(global-set-key [menu-bar tools encryption-decryption separator-file] 'last-kbd-macro)
(global-set-key [menu-bar tools encryption-decryption separator-keys] 'last-kbd-macro)
(global-set-key [menu-bar options mule set-various-coding-system separator-1] 'last-kbd-macro)
(global-set-key [menu-bar options mule set-various-coding-system separator-2] 'last-kbd-macro)
(global-set-key [menu-bar options mule set-various-coding-system separator-3] 'last-kbd-macro)
(global-set-key [menu-bar options showhide showhide-scroll-bar scrollbar-separator] 'last-kbd-macro)