*** w32menu.c.orig Mon May 12 16:12:12 1997
--- w32menu.c Fri May 16 19:00:40 1997
***************
*** 125,130 ****
--- 125,149 ----
    lpmm->menu_items_allocated = lpmm->menu_items_used = 0;
  }
  
+ /* Is this item a separator? */
+ static int
+ name_is_separator (name)
+      Lisp_Object name;
+ {
+   int isseparator = (((char *)XSTRING (name)->data)[0] == 0);
+ 
+   if (!isseparator)
+     {
+       /* Check if name string consists of only dashes ('-') */
+       char *string = (char *)XSTRING (name)->data;
+       while (*string == '-') string++;
+       isseparator = (*string == 0);
+     }
+ 
+   return isseparator;
+ }
+ 
+ 
  /* Indicate boundary between left and right.  */
  
  static void 
***************
*** 152,160 ****
    UINT fuFlags;
    Lisp_Object out_string;
    
!   if (NILP (name) 
!       || ((char *) XSTRING (name)->data)[0] == 0
!       || strcmp ((char *) XSTRING (name)->data, "--") == 0)
      fuFlags = MF_SEPARATOR;
    else 
      {
--- 171,177 ----
    UINT fuFlags;
    Lisp_Object out_string;
    
!   if (NILP (name) || name_is_separator (name))
      fuFlags = MF_SEPARATOR;
    else 
      {
***************
*** 649,659 ****
  	  pane_data = Fcdr (elt);
  	  CHECK_CONS (pane_data, 0);
  
! 	  new_hmenu = list_of_items (lpmm, pane_data);
! 	  if (new_hmenu == NULL) goto error;
  
! 	  AppendMenu (hmenu, MF_POPUP, (UINT)new_hmenu,
! 		      (char *) XSTRING (pane_name)->data);
  	}
      }
    else
--- 666,683 ----
  	  pane_data = Fcdr (elt);
  	  CHECK_CONS (pane_data, 0);
  
! 	  if (XSTRING (pane_name)->data[0] == 0)
! 	    {
! 	      list_of_items (hmenu, lpmm, pane_data);
! 	    }
! 	  else
! 	    {
! 	      new_hmenu = list_of_items (NULL, lpmm, pane_data);
! 	      if (new_hmenu == NULL) goto error;
  
! 	      AppendMenu (hmenu, MF_POPUP, (UINT)new_hmenu,
! 		          (char *) XSTRING (pane_name)->data);
! 	    }
  	}
      }
    else
***************
*** 665,671 ****
        CHECK_STRING (pane_name, 0);
        pane_data = Fcdr (elt);
        CHECK_CONS (pane_data, 0);
!       hmenu = list_of_items (lpmm, pane_data);
      }
    return (hmenu);
    
--- 689,695 ----
        CHECK_STRING (pane_name, 0);
        pane_data = Fcdr (elt);
        CHECK_CONS (pane_data, 0);
!       hmenu = list_of_items (NULL, lpmm, pane_data);
      }
    return (hmenu);
    
***************
*** 678,692 ****
  /* Push the items in a single pane defined by the alist PANE.  */
  
  static HMENU 
! list_of_items (lpmm, pane)
       menu_map * lpmm;
       Lisp_Object pane;
  {
    Lisp_Object tail, item, item1;
-   HMENU hmenu;
  
!   hmenu = CreatePopupMenu ();
!   if (hmenu == NULL) return NULL;
  
    for (tail = pane; !NILP (tail); tail = Fcdr (tail))
      {
--- 702,719 ----
  /* Push the items in a single pane defined by the alist PANE.  */
  
  static HMENU 
! list_of_items (hmenu, lpmm, pane)
!      HMENU hmenu;
       menu_map * lpmm;
       Lisp_Object pane;
  {
    Lisp_Object tail, item, item1;
  
!   if (hmenu == NULL)
!     {
!       hmenu = CreatePopupMenu ();
!       if (hmenu == NULL) return NULL;
!     }
  
    for (tail = pane; !NILP (tail); tail = Fcdr (tail))
      {
***************
*** 1705,1712 ****
      enable = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_ENABLE];
      //	  descrip = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY];
  
!     if (((char *) XSTRING (item_name)->data)[0] == 0
! 	|| strcmp ((char *) XSTRING (item_name)->data, "--") == 0)
        fuFlags = MF_SEPARATOR;
      else if (NILP (enable) || !XUINT (enable))
        fuFlags = MF_STRING | MF_GRAYED;
--- 1732,1738 ----
      enable = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_ENABLE];
      //	  descrip = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY];
  
!     if (name_is_separator (item_name))
        fuFlags = MF_SEPARATOR;
      else if (NILP (enable) || !XUINT (enable))
        fuFlags = MF_STRING | MF_GRAYED;
*** ChangeLog.orig Mon May 12 17:12:56 1997
--- ChangeLog Fri May 16 19:12:50 1997
***************
*** 1,3 ****
--- 1,21 ----
+ Fri May 16 19:08:34 1997  Nico Francois  <nico.francois@scala.nl>
+ 
+ 	* w32menu.c (name_is_separator): New function.  Will check if
+ 	a menu item name is a separator.  An empty name or a name consting
+ 	only of dashes ('-') is considered a separator.  Previously only
+ 	names with exactly two dashes ("--") where considered separators,
+ 	but some packages use more than two dashes when they want to add a
+ 	separator to a menu (vc-hooks.el for example).
+ 
+ Mon May 12 16:57:32 1997  Nico Francois  <nico.francois@scala.nl>
+ 
+ 	* w32menu.c (list_of_panes): If a pane's name is empty ("") items
+ 	are now placed in the main popup instead of a blank-named submenu.
+ 	This seems to be an undocumented feature of x-popup-menu.
+ 	(list_of_items): New argument HMENU.  If NULL the function will
+ 	work as before.  If non-NULL the function will add items to the
+ 	specified menu.
+ 
  Wed May 07 23:52:59 1997  Michael Welsh Duggan  <md5i@schenley.com>
  
  	* w32menu.c (get_frame_menubar_event): Check for the possibility
