You say: "But in the global-map there is no entry for M-x
, there are only entries for execute and menu."
That's not true. If you are just using C-h v global-map
then it's difficult to tell, unless you're good at reading the Lisp representation of a keymap.
Instead, load library help-fns+.el
(Help+) and use C-h M-k global-map
, to see a human-readable key listing for that keymap. There you'll see this entry, for M-x
:
M-x execute-extended-command
C-h M-k
is bound to command describe-keymap
.
[Emacs 27 will also have such a command, based on the one in help-fns+.el
, but the one in help-fns+.el
is still a bit better, IMO. Some of the features of the help-fns+.el
definition weren't adopted for vanilla Emacs.]
There is, however, another keymap variable that contains the execute-extended-command
binding for M-x
: variable esc-map
.
Meta keys are in fact on that keymap. ESC
followed by a key sequence is essentially the same as META
followed by that same key sequence. So M-x
is equivalent to ESC x
. ESC
is not a modifier key here; it's a prefix key.
When you see keys listed in *Help*
you'll often notice ESC
listed as a prefix key, and you'll see ESC
followed by some key sequence listed as a binding.
And you'll see in the value shown for C-h v global-map
an entry for ESC-prefix
, which means that ESC is a prefix key globally.