diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2000-08-27 15:47:59 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2000-08-27 15:47:59 +0000 |
commit | 9cd2ced7699766c4524a116d75012ecbb9f8d6ac (patch) | |
tree | 41e9aeb53543ba6fab5d26a73885ef60157d3a3c /src | |
parent | 67320f8d5c9d72b8c65efc1d6748cd5450e60cc2 (diff) | |
download | emacs-9cd2ced7699766c4524a116d75012ecbb9f8d6ac.tar.gz emacs-9cd2ced7699766c4524a116d75012ecbb9f8d6ac.tar.bz2 emacs-9cd2ced7699766c4524a116d75012ecbb9f8d6ac.zip |
(menu_bar_item): Detect duplicate entries for all items
to better match the key-lookup behavior.
Diffstat (limited to 'src')
-rw-r--r-- | src/keyboard.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 778cb16dbd6..35a199fa5c1 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -6346,29 +6346,27 @@ menu_bar_item (key, item) &XVECTOR (menu_bar_items_vector)->contents[i], (menu_bar_items_index - i - 4) * sizeof (Lisp_Object)); menu_bar_items_index -= 4; - return; } - - /* If there's no definition for this key yet, - just ignore `undefined'. */ - return; } - GCPRO1 (key); /* Is this necessary? */ - i = parse_menu_item (item, 0, 1); - UNGCPRO; - if (!i) - return; - /* If this keymap has already contributed to this KEY, don't contribute to it a second time. */ tem = Fmemq (key, menu_bar_one_keymap_changed_items); - if (!NILP (tem)) + if (!NILP (tem) || NILP (item)) return; menu_bar_one_keymap_changed_items = Fcons (key, menu_bar_one_keymap_changed_items); + /* We add to menu_bar_one_keymap_changed_items before doing the + parse_menu_item, so that if it turns out it wasn't a menu item, + it still correctly hides any further menu item. */ + GCPRO1 (key); + i = parse_menu_item (item, 0, 1); + UNGCPRO; + if (!i) + return; + item = XVECTOR (item_properties)->contents[ITEM_PROPERTY_DEF]; /* Find any existing item for this KEY. */ |