comparison src/keyboard.c @ 23975:b0040d620df9

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.
author Richard M. Stallman <rms@gnu.org>
date Sat, 02 Jan 1999 00:11:36 +0000
parents bf7a9485714a
children 2b8d4cd758b7
comparison
equal deleted inserted replaced
23974:dcc1ebab38c1 23975:b0040d620df9
5699 } 5699 }
5700 5700
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
5704 static Lisp_Object menu_bar_one_keymap_changed_items;
5705
5704 static void 5706 static void
5705 menu_bar_one_keymap (keymap) 5707 menu_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;
5711
5712 menu_bar_one_keymap_changed_items = Qnil;
5709 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 {
5713 item = XCONS (tail)->car; 5717 item = XCONS (tail)->car;
5737 menu_bar_item (key, item) 5741 menu_bar_item (key, item)
5738 Lisp_Object key, item; 5742 Lisp_Object 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 {
5745 /* If a map has an explicit `undefined' as definition, 5750 /* If a map has an explicit `undefined' as definition,
5746 discard any previously made menu bar item. */ 5751 discard any previously made menu bar item. */
5764 GCPRO1 (key); /* Is this necessary? */ 5769 GCPRO1 (key); /* Is this necessary? */
5765 i = parse_menu_item (item, 0, 1); 5770 i = parse_menu_item (item, 0, 1);
5766 UNGCPRO; 5771 UNGCPRO;
5767 if (!i) 5772 if (!i)
5768 return; 5773 return;
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);
5769 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. */
5773 for (i = 0; i < menu_bar_items_index; i += 4) 5787 for (i = 0; i < menu_bar_items_index; i += 4)
9073 staticpro (&internal_last_event_frame); 9087 staticpro (&internal_last_event_frame);
9074 9088
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);
9081 defsubr (&Srecursive_edit); 9098 defsubr (&Srecursive_edit);
9082 #ifdef HAVE_MOUSE 9099 #ifdef HAVE_MOUSE