kb->echo_string_ = val;
}
static void
+kset_echo_prompt (struct kboard *kb, Lisp_Object val)
+{
+ kb->echo_prompt_ = val;
+}
+static void
kset_kbd_queue (struct kboard *kb, Lisp_Object val)
{
kb->kbd_queue_ = val;
return;
/* Do nothing if we just printed a prompt. */
- if (current_kboard->echo_after_prompt
- == SCHARS (KVAR (current_kboard, echo_string)))
+ if (STRINGP (KVAR (current_kboard, echo_prompt))
+ && (SCHARS (KVAR (current_kboard, echo_prompt))
+ == SCHARS (KVAR (current_kboard, echo_string))))
return;
/* Do nothing if we have already put a dash at the end. */
if (current_kboard->immediate_echo)
{
ptrdiff_t i;
+ Lisp_Object prompt = KVAR (current_kboard, echo_prompt);
+ Lisp_Object prefix = call0 (Qinternal_echo_keystrokes_prefix);
kset_echo_string (current_kboard,
- call0 (Qinternal_echo_keystrokes_prefix));
+ NILP (prompt) ? prefix
+ : NILP (prefix) ? prompt
+ : concat2 (prompt, prefix));
for (i = 0; i < this_command_key_count; i++)
{
cancel_echoing (void)
{
current_kboard->immediate_echo = false;
- current_kboard->echo_after_prompt = -1;
+ kset_echo_prompt (current_kboard, Qnil);
kset_echo_string (current_kboard, Qnil);
ok_to_echo_at_next_pause = NULL;
echo_kboard = NULL;
bool saved_immediate_echo = current_kboard->immediate_echo;
struct kboard *saved_ok_to_echo = ok_to_echo_at_next_pause;
Lisp_Object saved_echo_string = KVAR (current_kboard, echo_string);
- ptrdiff_t saved_echo_after_prompt = current_kboard->echo_after_prompt;
+ Lisp_Object saved_echo_prompt = KVAR (current_kboard, echo_prompt);
/* Save the this_command_keys status. */
key_count = this_command_key_count;
cancel_echoing ();
ok_to_echo_at_next_pause = saved_ok_to_echo;
- /* Do not restore the echo area string when the user is
- introducing a prefix argument. Otherwise we end with
- repetitions of the partially introduced prefix
- argument. (bug#19875) */
- if (NILP (intern ("prefix-arg")))
- {
- kset_echo_string (current_kboard, saved_echo_string);
- }
- current_kboard->echo_after_prompt = saved_echo_after_prompt;
+ kset_echo_string (current_kboard, saved_echo_string);
+ kset_echo_prompt (current_kboard, saved_echo_prompt);
if (saved_immediate_echo)
echo_now ();
/* Install the string PROMPT as the beginning of the string
of echoing, so that it serves as a prompt for the next
character. */
- kset_echo_string (current_kboard, prompt);
- current_kboard->echo_after_prompt = SCHARS (prompt);
+ kset_echo_prompt (current_kboard, prompt);
echo_now ();
}
else if (cursor_in_echo_area
kb->kbd_queue_has_data = false;
kb->immediate_echo = false;
kset_echo_string (kb, Qnil);
- kb->echo_after_prompt = -1;
+ kset_echo_prompt (kb, Qnil);
kb->kbd_macro_buffer = 0;
kb->kbd_macro_bufsize = 0;
kset_defining_kbd_macro (kb, Qnil);
mark_object (KVAR (kb, Vlocal_function_key_map));
mark_object (KVAR (kb, Vdefault_minibuffer_frame));
mark_object (KVAR (kb, echo_string));
+ mark_object (KVAR (kb, echo_prompt));
}
{
union buffered_input_event *event;