(lispref.info)Inheritance and Keymaps


Next: Prefix Keys Prev: Creating Keymaps Up: Keymaps

Inheritance and Keymaps
=======================

   A keymap can inherit the bindings of another keymap.  This other
keymap is called the keymap's "parent", and is set with
`set-keymap-parent'.  When searching for a binding for a key sequence
in a particular keymap, that keymap itself will first be searched;
then, if no binding was found in the map and it has a parent, the
parent keymap will be searched; then the parent's parent keymap will be
searched, and so on, until either a binding for the key sequence is
found, or a keymap without a parent is encountered.

   `(current-global-map)' is the default parent of all keymaps.

 - Function: set-keymap-parent KEYMAP PARENT
     Sets the parent keymap of KEYMAP to PARENT.

     If you change the bindings in PARENT using `define-key' or other
     key-binding functions, these changes are visible in KEYMAP unless
     shadowed by bindings in that map.  The converse is not true: if
     you use `define-key' to change KEYMAP, that affects the bindings
     in that map, but has no effect on PARENT.

 - Function: keymap-parent KEYMAP
     Returns the parent keymap of KEYMAP, or `nil' if KEYMAP has no
     parent.


automatically generated by info2www