changeset 7521:2971264ff9aa

(xmenu_show): Completely ignore nameless panes except for the first pane. Ignore named panes too if KEYMAPS.
author Richard M. Stallman <rms@gnu.org>
date Tue, 17 May 1994 04:30:32 +0000
parents 6cc6328992d6
children 3049e726a161
files src/xmenu.c
diffstat 1 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/xmenu.c	Tue May 17 03:30:40 1994 +0000
+++ b/src/xmenu.c	Tue May 17 04:30:32 1994 +0000
@@ -1382,6 +1382,8 @@
 
   Position root_x, root_y;
 
+  int first_pane;
+
   *error = NULL;
 
   if (menu_items_used <= MENU_ITEMS_PANE_LENGTH)
@@ -1438,6 +1440,7 @@
   wv->value = 0;
   wv->enabled = 1;
   first_wv = wv;
+  first_pane = 1;
  
   /* Loop over all panes and items, filling in the tree.  */
   i = 0;
@@ -1448,12 +1451,14 @@
 	  submenu_stack[submenu_depth++] = save_wv;
 	  save_wv = prev_wv;
 	  prev_wv = 0;
+	  first_pane = 1;
 	  i++;
 	}
       else if (EQ (XVECTOR (menu_items)->contents[i], Qlambda))
 	{
 	  prev_wv = save_wv;
 	  save_wv = submenu_stack[--submenu_depth];
+	  first_pane = 0;
 	  i++;
 	}
       else if (EQ (XVECTOR (menu_items)->contents[i], Qt)
@@ -1480,7 +1485,7 @@
 	  /* If the pane has a meaningful name,
 	     make the pane a top-level menu item
 	     with its items as a submenu beneath it.  */
-	  if (strcmp (pane_string, ""))
+	  if (!keymaps && strcmp (pane_string, ""))
 	    {
 	      wv = malloc_widget_value ();
 	      if (save_wv)
@@ -1492,9 +1497,15 @@
 		wv->name++;
 	      wv->value = 0;
 	      wv->enabled = 1;
+	      save_wv = wv;
+	      prev_wv = 0;
 	    }
-	  save_wv = wv;
-	  prev_wv = 0;
+	  else if (first_pane)
+	    {
+	      save_wv = wv;
+	      prev_wv = 0;
+	    }
+	  first_pane = 0;
 	  i += MENU_ITEMS_PANE_LENGTH;
 	}
       else