aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2003-05-04 01:39:33 +0000
committerStefan Monnier2003-05-04 01:39:33 +0000
commit4216b545a9294b1a0126a934cea7660bef0c4627 (patch)
treefa988d15509bb3757caad6b02383f2fea5b5ca00 /src
parent0695ce9138846ceb06db58f1fc5b3d174074a4f1 (diff)
downloademacs-4216b545a9294b1a0126a934cea7660bef0c4627.tar.gz
emacs-4216b545a9294b1a0126a934cea7660bef0c4627.zip
(input_available_signal): Mark static.
(menu_bar_items): Use map_keymap. (menu_bar_one_keymap): Remove. (menu_bar_item): Adjust arglist (for use in map_keymap). Properly hide a second binding when not both are keymaps.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c51
1 files changed, 12 insertions, 39 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 70c9d90530d..454200f6193 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -6689,7 +6689,7 @@ read_avail_input (expected)
6689#ifdef SIGIO /* for entire page */ 6689#ifdef SIGIO /* for entire page */
6690/* Note SIGIO has been undef'd if FIONREAD is missing. */ 6690/* Note SIGIO has been undef'd if FIONREAD is missing. */
6691 6691
6692SIGTYPE 6692static SIGTYPE
6693input_available_signal (signo) 6693input_available_signal (signo)
6694 int signo; 6694 int signo;
6695{ 6695{
@@ -6855,7 +6855,10 @@ menu_bar_items (old)
6855 def = get_keymap (access_keymap (maps[mapno], Qmenu_bar, 1, 0, 1), 6855 def = get_keymap (access_keymap (maps[mapno], Qmenu_bar, 1, 0, 1),
6856 0, 1); 6856 0, 1);
6857 if (CONSP (def)) 6857 if (CONSP (def))
6858 menu_bar_one_keymap (def); 6858 {
6859 menu_bar_one_keymap_changed_items = Qnil;
6860 map_keymap (def, menu_bar_item, Qnil, NULL, 1);
6861 }
6859 } 6862 }
6860 6863
6861 /* Move to the end those items that should be at the end. */ 6864 /* Move to the end those items that should be at the end. */
@@ -6909,48 +6912,15 @@ menu_bar_items (old)
6909 return menu_bar_items_vector; 6912 return menu_bar_items_vector;
6910} 6913}
6911 6914
6912/* Scan one map KEYMAP, accumulating any menu items it defines
6913 in menu_bar_items_vector. */
6914
6915static Lisp_Object menu_bar_one_keymap_changed_items;
6916
6917static void
6918menu_bar_one_keymap (keymap)
6919 Lisp_Object keymap;
6920{
6921 Lisp_Object tail, item;
6922
6923 menu_bar_one_keymap_changed_items = Qnil;
6924
6925 /* Loop over all keymap entries that have menu strings. */
6926 for (tail = keymap; CONSP (tail); tail = XCDR (tail))
6927 {
6928 item = XCAR (tail);
6929 if (CONSP (item))
6930 menu_bar_item (XCAR (item), XCDR (item));
6931 else if (VECTORP (item))
6932 {
6933 /* Loop over the char values represented in the vector. */
6934 int len = XVECTOR (item)->size;
6935 int c;
6936 for (c = 0; c < len; c++)
6937 {
6938 Lisp_Object character;
6939 XSETFASTINT (character, c);
6940 menu_bar_item (character, XVECTOR (item)->contents[c]);
6941 }
6942 }
6943 }
6944}
6945
6946/* Add one item to menu_bar_items_vector, for KEY, ITEM_STRING and DEF. 6915/* Add one item to menu_bar_items_vector, for KEY, ITEM_STRING and DEF.
6947 If there's already an item for KEY, add this DEF to it. */ 6916 If there's already an item for KEY, add this DEF to it. */
6948 6917
6949Lisp_Object item_properties; 6918Lisp_Object item_properties;
6950 6919
6951static void 6920static void
6952menu_bar_item (key, item) 6921menu_bar_item (key, item, dummy1, dummy2)
6953 Lisp_Object key, item; 6922 Lisp_Object key, item, dummy1;
6923 void *dummy2;
6954{ 6924{
6955 struct gcpro gcpro1; 6925 struct gcpro gcpro1;
6956 int i; 6926 int i;
@@ -7023,7 +6993,10 @@ menu_bar_item (key, item)
7023 { 6993 {
7024 Lisp_Object old; 6994 Lisp_Object old;
7025 old = XVECTOR (menu_bar_items_vector)->contents[i + 2]; 6995 old = XVECTOR (menu_bar_items_vector)->contents[i + 2];
7026 XVECTOR (menu_bar_items_vector)->contents[i + 2] = Fcons (item, old); 6996 /* If the new and the old items are not both keymaps,
6997 the lookup will only find `item'. */
6998 item = Fcons (item, KEYMAPP (item) && KEYMAPP (XCAR (old)) ? old : Qnil);
6999 XVECTOR (menu_bar_items_vector)->contents[i + 2] = item;
7027 } 7000 }
7028} 7001}
7029 7002