Add an index for explicit selective display.
[bpt/emacs.git] / src / menu.c
index f741d68..d87d495 100644 (file)
@@ -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;
@@ -1440,14 +1440,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))