Fcons (Vminibuffer_history_variable,
minibuf_save_list))))));
minibuf_save_list
- = Fcons (current_buffer->minibuffer_prompt_length,
+ = Fcons (current_buffer->prompt_end_charpos,
minibuf_save_list);
record_unwind_protect (read_minibuf_unwind, Qnil);
/* Now that we can restore all those variables, start changing them. */
- minibuf_prompt_width = 0; /* xdisp.c puts in the right value. */
+ minibuf_prompt_width = 0;
minibuf_prompt = Fcopy_sequence (prompt);
Vminibuffer_history_position = histpos;
Vminibuffer_history_variable = histvar;
Fmake_local_variable (Qprint_escape_newlines);
print_escape_newlines = 1;
- XSETFASTINT (current_buffer->minibuffer_prompt_length, 0);
+ XSETFASTINT (current_buffer->prompt_end_charpos, 0);
/* Erase the buffer. */
{
/* Insert the prompt, record where it ends. */
Finsert (1, &minibuf_prompt);
- XSETFASTINT (current_buffer->minibuffer_prompt_length, PT);
+ XSETFASTINT (current_buffer->prompt_end_charpos, PT);
if (PT > BEG)
{
Fput_text_property (make_number (BEG), make_number (PT),
Fput_text_property (make_number (BEG), make_number (PT),
Qread_only, Qt, Qnil);
}
+
+ minibuf_prompt_width = current_column ();
/* If appropriate, copy enable-multibyte-characters into the minibuffer. */
if (inherit_input_method)
/* Make minibuffer contents into a string. */
Fset_buffer (minibuffer);
- val = make_buffer_string (1, Z, allow_props);
+ val = make_buffer_string (current_buffer->prompt_end_charpos,
+ Z, allow_props);
/* VAL is the string of minibuffer text. */
Fset_buffer (XWINDOW (window)->buffer);
/* Restore prompt, etc, from outer minibuffer level. */
- current_buffer->minibuffer_prompt_length = Fcar (minibuf_save_list);
+ current_buffer->prompt_end_charpos = Fcar (minibuf_save_list);
minibuf_save_list = Fcdr (minibuf_save_list);
minibuf_prompt = Fcar (minibuf_save_list);
/* When we get to the outmost level, make sure we resize the
mini-window back to its normal size. */
if (minibuf_level == 0)
- resize_mini_window (XWINDOW (window));
+ resize_mini_window (XWINDOW (window), 0);
/* Make sure minibuffer window is erased, not ignored. */
windows_or_buffers_changed++;
Lisp_Object val;
/* Allow user to specify null string */
- if (XFASTINT (current_buffer->minibuffer_prompt_length) == ZV)
+ if (XFASTINT (current_buffer->prompt_end_charpos) == ZV)
goto exit;
if (!NILP (test_completion (Fbuffer_string ())))
{
int prompt_end_charpos, prompt_end_bytepos;
- prompt_end_charpos = XFASTINT (current_buffer->minibuffer_prompt_length);
+ prompt_end_charpos = XFASTINT (current_buffer->prompt_end_charpos);
prompt_end_bytepos = CHAR_TO_BYTE (prompt_end_charpos);
i = ZV - prompt_end_charpos;
i_byte = ZV_BYTE - prompt_end_bytepos;
/* If got no characters, print help for user. */
- if (i == ZV - XFASTINT (current_buffer->minibuffer_prompt_length))
+ if (i == ZV - XFASTINT (current_buffer->prompt_end_charpos))
{
if (auto_help)
Fminibuffer_completion_help ();
DEFUN ("minibuffer-prompt-width", Fminibuffer_prompt_width,
Sminibuffer_prompt_width, 0, 0, 0,
- "Return the display width of the minibuffer prompt.\n\
-Return 0 if current buffer is not a mini-buffer.")
+ "Return the display width of the minibuffer prompt.")
()
{
- Lisp_Object width;
- if (NILP (current_buffer->minibuffer_prompt_length))
- width = make_number (0);
- else
- width = make_number (current_buffer->minibuffer_prompt_length);
- return width;
+ return make_number (minibuf_prompt_width);
}
Value is 0 if current buffer is not a mini-buffer.")
()
{
- return (NILP (current_buffer->minibuffer_prompt_length)
+ return (NILP (current_buffer->prompt_end_charpos)
? make_number (0)
- : make_number (current_buffer->minibuffer_prompt_length));
+ : make_number (current_buffer->prompt_end_charpos));
}