From 51b403bdcb9af76833a11a668cc9be0f49d62e72 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 4 Oct 2010 14:16:22 -0400 Subject: [PATCH] Don't add an echo dash for the first keystroke (Bug#7137). * src/keyboard.c (echo_prompt): Function moved into read_key_sequence. (read_key_sequence): Inline echo_prompt. (echo_dash): Add a dash only if key is continued (Bug#7137). --- src/ChangeLog | 6 ++++++ src/keyboard.c | 24 +++++++++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 7c907dd45ef..6f388cd7283 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2010-10-04 Chong Yidong + + * keyboard.c (echo_prompt): Function moved into read_key_sequence. + (read_key_sequence): Inline echo_prompt. + (echo_dash): Add a dash only if key is continued (Bug#7137). + 2010-10-04 Dan Nicolaescu Remove O_RDONLY, O_WRONLY definitions, not needed. diff --git a/src/keyboard.c b/src/keyboard.c index 9e7225805d5..9af26cd427d 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -645,18 +645,6 @@ static int store_user_signal_events (void); static int cannot_suspend; -/* Install the string STR as the beginning of the string of echoing, - so that it serves as a prompt for the next character. - Also start echoing. */ - -void -echo_prompt (Lisp_Object str) -{ - current_kboard->echo_string = str; - current_kboard->echo_after_prompt = SCHARS (str); - echo_now (); -} - /* Add C to the echo string, if echoing is going on. C can be a character, which is printed prettily ("M-C-x" and all that jazz), or a symbol, whose name is printed. */ @@ -755,6 +743,9 @@ echo_dash (void) if (NILP (current_kboard->echo_string)) return; + if (this_command_key_count == 0) + return; + if (!current_kboard->immediate_echo && SCHARS (current_kboard->echo_string) == 0) return; @@ -9125,7 +9116,14 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, if (INTERACTIVE) { if (!NILP (prompt)) - echo_prompt (prompt); + { + /* Install the string STR as the beginning of the string of + echoing, so that it serves as a prompt for the next + character. */ + current_kboard->echo_string = prompt; + current_kboard->echo_after_prompt = SCHARS (prompt); + echo_now (); + } else if (cursor_in_echo_area && (FLOATP (Vecho_keystrokes) || INTEGERP (Vecho_keystrokes)) && NILP (Fzerop (Vecho_keystrokes))) -- 2.39.5