+ if (!*accel)
+ {
+ if (len + 2 > maxlen)
+ signal_simple_error ("Menu item produces too long displayable string",
+ error_name);
+ ptr = item;
+ memmove (ptr + 1, ptr, len + 1);
+ /* #### urk ! We need a reference translation table for
+ case changes that aren't buffer-specific. */
+ *accel = DOWNCASE (current_buffer, charptr_emchar (ptr + 1));
+ *ptr = '&';
+
+ len++;
+ }
+
+ return len;
+}
+
+/*
+ * This returns Windows-style menu item string:
+ * "Left Flush\tRight Flush"
+ */
+
+/* #### This is junk. Need correct handling of sizes. Use a Bufbyte_dynarr,
+ not a static buffer. */
+static char*
+displayable_menu_item (Lisp_Object gui_item, int bar_p, Emchar *accel)
+{
+ unsigned int ll;
+
+ /* We construct the name in a static buffer. That's fine, because
+ menu items longer than 128 chars are probably programming errors,
+ and better be caught than displayed! */
+
+ static char buf[MAX_MENUITEM_LENGTH+2];
+
+ /* Left flush part of the string */
+ ll = gui_item_display_flush_left (gui_item, buf, MAX_MENUITEM_LENGTH);
+
+ ll = msw_translate_menu_or_dialog_item ((Bufbyte *) buf, ll,
+ MAX_MENUITEM_LENGTH, accel,
+ XGUI_ITEM (gui_item)->name);
+