diff options
| author | Stefan Monnier | 2011-07-02 00:27:41 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2011-07-02 00:27:41 -0400 |
| commit | 3349e122e2ed4e1e96851bdf84ce8ae4732b6420 (patch) | |
| tree | ac1309f41e4c5dc26ddd8c7f313ece238fa65809 /src/keyboard.c | |
| parent | 3de63bf809c2a36a5eae8e7383b2590c5ab1bcf7 (diff) | |
| download | emacs-3349e122e2ed4e1e96851bdf84ce8ae4732b6420.tar.gz emacs-3349e122e2ed4e1e96851bdf84ce8ae4732b6420.zip | |
Add multiple inheritance to keymaps.
* src/keymap.c (Fmake_composed_keymap): New function.
(Fset_keymap_parent): Simplify.
(fix_submap_inheritance): Remove.
(access_keymap_1): New function extracted from access_keymap to handle
embedded parents and handle lists of maps.
(access_keymap): Use it.
(Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
(Fcopy_keymap): Handle embedded parents.
(Fcommand_remapping, define_as_prefix): Simplify.
(Fkey_binding): Simplify.
(syms_of_keymap): Move minibuffer-local-completion-map,
minibuffer-local-filename-completion-map,
minibuffer-local-must-match-map, and
minibuffer-local-filename-must-match-map to Elisp.
(syms_of_keymap): Defsubr make-composed-keymap.
* src/keyboard.c (menu_bar_items): Use map_keymap_canonical.
(parse_menu_item): Trivial simplification.
* lisp/subr.el (remq): Don't allocate if it's not needed.
(keymap--menu-item-binding, keymap--menu-item-with-binding)
(keymap--merge-bindings): New functions.
(keymap-canonicalize): Use them to refine the canonicalization.
* lisp/minibuffer.el (minibuffer-local-completion-map)
(minibuffer-local-must-match-map): Move initialization from C.
(minibuffer-local-filename-completion-map): Move initialization from C;
don't inherit from anything here.
(minibuffer-local-filename-must-match-map): Make obsolete.
(completing-read-default): Use make-composed-keymap to combine
minibuffer-local-filename-completion-map with either
minibuffer-local-must-match-map or
minibuffer-local-filename-completion-map.
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index bffe2b035dc..3441f1dfd12 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -7470,7 +7470,7 @@ menu_bar_items (Lisp_Object old) | |||
| 7470 | if (CONSP (def)) | 7470 | if (CONSP (def)) |
| 7471 | { | 7471 | { |
| 7472 | menu_bar_one_keymap_changed_items = Qnil; | 7472 | menu_bar_one_keymap_changed_items = Qnil; |
| 7473 | map_keymap (def, menu_bar_item, Qnil, NULL, 1); | 7473 | map_keymap_canonical (def, menu_bar_item, Qnil, NULL); |
| 7474 | } | 7474 | } |
| 7475 | } | 7475 | } |
| 7476 | 7476 | ||
| @@ -7811,7 +7811,7 @@ parse_menu_item (Lisp_Object item, int inmenubar) | |||
| 7811 | /* If we got no definition, this item is just unselectable text which | 7811 | /* If we got no definition, this item is just unselectable text which |
| 7812 | is OK in a submenu but not in the menubar. */ | 7812 | is OK in a submenu but not in the menubar. */ |
| 7813 | if (NILP (def)) | 7813 | if (NILP (def)) |
| 7814 | return (inmenubar ? 0 : 1); | 7814 | return (!inmenubar); |
| 7815 | 7815 | ||
| 7816 | /* See if this is a separate pane or a submenu. */ | 7816 | /* See if this is a separate pane or a submenu. */ |
| 7817 | def = AREF (item_properties, ITEM_PROPERTY_DEF); | 7817 | def = AREF (item_properties, ITEM_PROPERTY_DEF); |