aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1999-01-02 00:11:36 +0000
committerRichard M. Stallman1999-01-02 00:11:36 +0000
commit759860a6af74f327a9b1b4ddb49a42929e10f92e (patch)
tree8a014eced1d5532aa4a04b26c8a96d35b12c700b /src
parente0a6ee5e19136304d6e5b97b42279b80ff9334ab (diff)
downloademacs-759860a6af74f327a9b1b4ddb49a42929e10f92e.tar.gz
emacs-759860a6af74f327a9b1b4ddb49a42929e10f92e.zip
In each active map, for each menu bar item, use only the first submap.
(menu_bar_one_keymap): Initialize menu_bar_one_keymap_changed_items. (menu_bar_item): Update and test menu_bar_one_keymap_changed_items. (syms_of_keyboard): Staticpro and init it.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 4f531457214..7ba7f0a6319 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -5701,12 +5701,16 @@ menu_bar_items (old)
5701/* Scan one map KEYMAP, accumulating any menu items it defines 5701/* Scan one map KEYMAP, accumulating any menu items it defines
5702 in menu_bar_items_vector. */ 5702 in menu_bar_items_vector. */
5703 5703
5704static Lisp_Object menu_bar_one_keymap_changed_items;
5705
5704static void 5706static void
5705menu_bar_one_keymap (keymap) 5707menu_bar_one_keymap (keymap)
5706 Lisp_Object keymap; 5708 Lisp_Object keymap;
5707{ 5709{
5708 Lisp_Object tail, item, table; 5710 Lisp_Object tail, item, table;
5709 5711
5712 menu_bar_one_keymap_changed_items = Qnil;
5713
5710 /* Loop over all keymap entries that have menu strings. */ 5714 /* Loop over all keymap entries that have menu strings. */
5711 for (tail = keymap; CONSP (tail); tail = XCONS (tail)->cdr) 5715 for (tail = keymap; CONSP (tail); tail = XCONS (tail)->cdr)
5712 { 5716 {
@@ -5739,6 +5743,7 @@ menu_bar_item (key, item)
5739{ 5743{
5740 struct gcpro gcpro1; 5744 struct gcpro gcpro1;
5741 int i; 5745 int i;
5746 Lisp_Object tem;
5742 5747
5743 if (EQ (item, Qundefined)) 5748 if (EQ (item, Qundefined))
5744 { 5749 {
@@ -5767,6 +5772,15 @@ menu_bar_item (key, item)
5767 if (!i) 5772 if (!i)
5768 return; 5773 return;
5769 5774
5775 /* If this keymap has already contributed to this KEY,
5776 don't contribute to it a second time. */
5777 tem = Fmemq (key, menu_bar_one_keymap_changed_items);
5778 if (!NILP (tem))
5779 return;
5780
5781 menu_bar_one_keymap_changed_items
5782 = Fcons (key, menu_bar_one_keymap_changed_items);
5783
5770 item = XVECTOR (item_properties)->contents[ITEM_PROPERTY_DEF]; 5784 item = XVECTOR (item_properties)->contents[ITEM_PROPERTY_DEF];
5771 5785
5772 /* Find any existing item for this KEY. */ 5786 /* Find any existing item for this KEY. */
@@ -9075,6 +9089,9 @@ syms_of_keyboard ()
9075 read_key_sequence_cmd = Qnil; 9089 read_key_sequence_cmd = Qnil;
9076 staticpro (&read_key_sequence_cmd); 9090 staticpro (&read_key_sequence_cmd);
9077 9091
9092 menu_bar_one_keymap_changed_items = Qnil;
9093 staticpro (&menu_bar_one_keymap_changed_items);
9094
9078 defsubr (&Sevent_convert_list); 9095 defsubr (&Sevent_convert_list);
9079 defsubr (&Sread_key_sequence); 9096 defsubr (&Sread_key_sequence);
9080 defsubr (&Sread_key_sequence_vector); 9097 defsubr (&Sread_key_sequence_vector);