Next: , Previous: , Up: Mastering Key Bindings in Emacs   [Index]


5.5.2 Keymaps

Emacs does not assign meanings to keys directly. Instead, Emacs assigns meanings to named “commands”, and then gives keys their meanings by “binding” them to commands. The bindings between keys and commands are recorded in tables called "keymaps." Emacs has many different keymaps, each used on particular occasions.

A keymap is an internal data structure used by Emacs to store keys and their associated actions. Keymaps are rarely modified directly, but through a set of commands that manipulate the data structure for you.

Every buffer and most major and minor modes have a keymap, and that keymap defines what the keys do when key sequences are sent to that buffer. Keys can be divided into three categories:

undefined

self-explanatory

prefix key

are parts of a complete key, and each constituent part of a prefix key is made up of its own keymap

complete key

a command that, when input, executes its associated command

To enumerate all the active minor and major mode key bindings in a buffer, type:

If you know part of a key sequence, type out that part, then type the following to get a list of all keys that belong to that sequence.