aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorStefan Monnier2000-08-27 15:47:59 +0000
committerStefan Monnier2000-08-27 15:47:59 +0000
commit9cd2ced7699766c4524a116d75012ecbb9f8d6ac (patch)
tree41e9aeb53543ba6fab5d26a73885ef60157d3a3c /src/keyboard.c
parent67320f8d5c9d72b8c65efc1d6748cd5450e60cc2 (diff)
downloademacs-9cd2ced7699766c4524a116d75012ecbb9f8d6ac.tar.gz
emacs-9cd2ced7699766c4524a116d75012ecbb9f8d6ac.zip
(menu_bar_item): Detect duplicate entries for all items
to better match the key-lookup behavior.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c22
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)
6346 &XVECTOR (menu_bar_items_vector)->contents[i], 6346 &XVECTOR (menu_bar_items_vector)->contents[i],
6347 (menu_bar_items_index - i - 4) * sizeof (Lisp_Object)); 6347 (menu_bar_items_index - i - 4) * sizeof (Lisp_Object));
6348 menu_bar_items_index -= 4; 6348 menu_bar_items_index -= 4;
6349 return;
6350 } 6349 }
6351
6352 /* If there's no definition for this key yet,
6353 just ignore `undefined'. */
6354 return;
6355 } 6350 }
6356 6351
6357 GCPRO1 (key); /* Is this necessary? */
6358 i = parse_menu_item (item, 0, 1);
6359 UNGCPRO;
6360 if (!i)
6361 return;
6362
6363 /* If this keymap has already contributed to this KEY, 6352 /* If this keymap has already contributed to this KEY,
6364 don't contribute to it a second time. */ 6353 don't contribute to it a second time. */
6365 tem = Fmemq (key, menu_bar_one_keymap_changed_items); 6354 tem = Fmemq (key, menu_bar_one_keymap_changed_items);
6366 if (!NILP (tem)) 6355 if (!NILP (tem) || NILP (item))
6367 return; 6356 return;
6368 6357
6369 menu_bar_one_keymap_changed_items 6358 menu_bar_one_keymap_changed_items
6370 = Fcons (key, menu_bar_one_keymap_changed_items); 6359 = Fcons (key, menu_bar_one_keymap_changed_items);
6371 6360
6361 /* We add to menu_bar_one_keymap_changed_items before doing the
6362 parse_menu_item, so that if it turns out it wasn't a menu item,
6363 it still correctly hides any further menu item. */
6364 GCPRO1 (key);
6365 i = parse_menu_item (item, 0, 1);
6366 UNGCPRO;
6367 if (!i)
6368 return;
6369
6372 item = XVECTOR (item_properties)->contents[ITEM_PROPERTY_DEF]; 6370 item = XVECTOR (item_properties)->contents[ITEM_PROPERTY_DEF];
6373 6371
6374 /* Find any existing item for this KEY. */ 6372 /* Find any existing item for this KEY. */