Remove stale comment from fileio.c.
[bpt/emacs.git] / src / menu.c
index f741d68..e33c647 100644 (file)
@@ -55,7 +55,7 @@ extern HMENU current_popup_menu;
 static bool
 have_boxes (void)
 {
-#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI)
+#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI) || defined(HAVE_NS)
   if (FRAME_WINDOW_P (XFRAME (Vmenu_updating_frame)))
     return 1;
 #endif
@@ -1036,11 +1036,11 @@ find_and_return_menu_selection (struct frame *f, bool keymaps, void *client_data
 }
 #endif  /* HAVE_NS */
 
-int
-menu_item_width (const char *str)
+ptrdiff_t
+menu_item_width (const unsigned char *str)
 {
-  int len;
-  const char *p;
+  ptrdiff_t len;
+  const unsigned char *p;
 
   for (len = 0, p = str; *p; )
     {
@@ -1104,7 +1104,7 @@ into menu items.  */)
          if (XINT (pos) <= col
              /* We use <= so the blank between 2 items on a TTY is
                 considered part of the previous item.  */
-             && col <= XINT (pos) + menu_item_width (SSDATA (str)))
+             && col <= XINT (pos) + menu_item_width (SDATA (str)))
            {
              item = AREF (items, i);
              return item;
@@ -1178,7 +1178,6 @@ no quit occurs and `x-popup-menu' returns nil.  */)
        keybinding equivalents, but we don't do that any more anyway.  */
     return Qnil;
 
-#ifdef HAVE_MENUS
   {
     bool get_current_pos_p = 0;
 
@@ -1315,7 +1314,6 @@ no quit occurs and `x-popup-menu' returns nil.  */)
 
     XSETFRAME (Vmenu_updating_frame, f);
   }
-#endif /* HAVE_MENUS */
 
   /* Now parse the lisp menus.  */
   record_unwind_protect_void (unuse_menu_items);
@@ -1398,7 +1396,6 @@ no quit occurs and `x-popup-menu' returns nil.  */)
 
   unbind_to (specpdl_count, Qnil);
 
-#ifdef HAVE_MENUS
 #ifdef HAVE_WINDOW_SYSTEM
   /* Hide a previous tip, if any.  */
   if (!FRAME_TERMCAP_P (f))
@@ -1440,14 +1437,9 @@ no quit occurs and `x-popup-menu' returns nil.  */)
   else
 #endif
 #if (defined (HAVE_X_WINDOWS) || defined (MSDOS))
-  /* Assume last_event_timestamp is the timestamp of the button event.
-     Is this assumption ever violated?  We can't use the timestamp
-     stored within POSITION because there the top bits from the actual
-     timestamp may be truncated away (Bug#4930).  */
   if (FRAME_X_P (f) || FRAME_MSDOS_P (f))
     selection = xmenu_show (f, xpos, ypos, for_click,
-                           keymaps, title, &error_name,
-                           last_event_timestamp);
+                           keymaps, title, &error_name);
   else
 #endif
   if (FRAME_TERMCAP_P (f))
@@ -1465,16 +1457,12 @@ no quit occurs and `x-popup-menu' returns nil.  */)
     FRAME_DISPLAY_INFO (f)->grabbed = 0;
 #endif
 
-#endif /* HAVE_MENUS */
-
   UNGCPRO;
 
   if (error_name) error ("%s", error_name);
   return selection;
 }
 
-#ifdef HAVE_MENUS
-
 DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 3, 0,
        doc: /* Pop up a dialog box and return user's selection.
 POSITION specifies which frame to use.
@@ -1610,8 +1598,6 @@ for instance using the window manager, then this produces a quit and
   }
 }
 
-#endif /* HAVE_MENUS */
-
 void
 syms_of_menu (void)
 {
@@ -1620,9 +1606,6 @@ syms_of_menu (void)
   menu_items_inuse = Qnil;
 
   defsubr (&Sx_popup_menu);
-
-#ifdef HAVE_MENUS
   defsubr (&Sx_popup_dialog);
-#endif
   defsubr (&Smenu_bar_menu_at_x_y);
 }