if (! menu_prompting)
return Qnil;
+ /* Get the menu name from the first map that has one (a prompt string). */
+ for (mapno = 0; mapno < nmaps; mapno++)
+ {
+ name = Fkeymap_prompt (maps[mapno]);
+ if (!NILP (name))
+ break;
+ }
+
+ /* If we don't have any menus, just read a character normally. */
+ if (!STRINGP (name))
+ return Qnil;
+
/* Make sure we have a big enough buffer for the menu text. */
+ width = max (width, SBYTES (name));
if (read_char_minibuf_menu_text == 0)
{
read_char_minibuf_menu_width = width + 4;
}
menu = read_char_minibuf_menu_text;
- /* Get the menu name from the first map that has one (a prompt string). */
- for (mapno = 0; mapno < nmaps; mapno++)
- {
- name = Fkeymap_prompt (maps[mapno]);
- if (!NILP (name))
- break;
- }
-
- /* If we don't have any menus, just read a character normally. */
- if (!STRINGP (name))
- return Qnil;
-
/* Prompt string always starts with map's prompt, and a space. */
strcpy (menu, SDATA (name));
nlength = SBYTES (name);