2001-05-28 Gerd Moellmann <gerd@gnu.org>
+ * xmenu.c (xmenu_show) [!HAVE_MULTILINGUAL_MENU]: Don't overwrite
+ an item's name with its key description in case the description
+ is a multibyte string.
+
+ * keymap.c (Fsingle_key_description): Create a multibyte string
+ only if necessary.
+
* macros.c (Fstart_kbd_macro): Doc fix.
* xterm.c (cursor_in_mouse_face_p): New function.
}
else
{
- char tem[KEY_DESCRIPTION_SIZE];
- int len;
-
- *push_key_description (XUINT (key), tem, 1) = 0;
- len = strlen (tem);
- return make_multibyte_string (tem,
- multibyte_chars_in_text (tem, len),
- len);
+ char tem[KEY_DESCRIPTION_SIZE], *end;
+ int nbytes, nchars;
+ Lisp_Object string;
+
+ end = push_key_description (XUINT (key), tem, 1);
+ nbytes = end - tem;
+ nchars = multibyte_chars_in_text (tem, nbytes);
+ if (nchars == nbytes)
+ string = build_string (tem);
+ else
+ string = make_multibyte_string (tem, nchars, nbytes);
+ return string;
}
}
else if (SYMBOLP (key)) /* Function key or event-symbol */