changeset 48946:2c4a754e02b6

(parse_single_submenu): Use individual keymap's prompt string as pane name, if there is one. (set_frame_menubar): Save menu_items_n_panes from each call to parse_single_submenu and use it when calling digest_single_submenu.
author Richard M. Stallman <rms@gnu.org>
date Mon, 23 Dec 2002 18:06:42 +0000
parents a96801f68a82
children 3bdd36228f48
files src/xmenu.c
diffstat 1 files changed, 15 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/xmenu.c	Mon Dec 23 18:04:45 2002 +0000
+++ b/src/xmenu.c	Mon Dec 23 18:06:42 2002 +0000
@@ -1434,7 +1434,13 @@
 			  Qnil, Qnil, Qnil, Qnil);
 	}
       else
-	single_keymap_panes (mapvec[i], item_name, item_key, 0, 10);
+	{
+	  Lisp_Object prompt;
+	  prompt = Fkeymap_prompt (mapvec[i]);
+	  single_keymap_panes (mapvec[i],
+			       !NILP (prompt) ? prompt : item_name,
+			       item_key, 0, 10);
+	}
     }
 
   return top_level_items;
@@ -1465,10 +1471,10 @@
   save_wv = 0;
   prev_wv = 0;
  
-  /* Loop over all panes and items made during this call
-     and construct a tree of widget_value objects.
-     Ignore the panes and items made by previous calls to
-     single_submenu, even though those are also in menu_items.  */
+  /* Loop over all panes and items made by the preceding call
+     to parse_single_submenu and construct a tree of widget_value objects.
+     Ignore the panes and items used by previous calls to
+     digest_single_submenu, even though those are also in menu_items.  */
   i = start;
   while (i < end)
     {
@@ -1674,7 +1680,7 @@
   widget_value *wv, *first_wv, *prev_wv = 0;
   int i, last_i;
   int *submenu_start, *submenu_end;
-  int *submenu_top_level_items;
+  int *submenu_top_level_items, *submenu_n_panes;
 
   LWLIB_ID id;
 
@@ -1752,6 +1758,7 @@
       menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0;
       submenu_start = (int *) alloca (XVECTOR (items)->size * sizeof (int *));
       submenu_end = (int *) alloca (XVECTOR (items)->size * sizeof (int *));
+      submenu_n_panes = (int *) alloca (XVECTOR (items)->size * sizeof (int));
       submenu_top_level_items
 	= (int *) alloca (XVECTOR (items)->size * sizeof (int *));
       init_menu_items ();
@@ -1772,6 +1779,7 @@
 	  menu_items_n_panes = 0;
 	  submenu_top_level_items[i]
 	    = parse_single_submenu (key, string, maps);
+	  submenu_n_panes[i] = menu_items_n_panes;
 
 	  submenu_end[i] = menu_items_used;
 	}
@@ -1791,6 +1799,7 @@
 
       for (i = 0; i < last_i; i += 4)
 	{
+	  menu_items_n_panes = submenu_n_panes[i];
 	  wv = digest_single_submenu (submenu_start[i], submenu_end[i],
 				      submenu_top_level_items[i]);
 	  if (prev_wv)