aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2010-10-04 14:16:22 -0400
committerChong Yidong2010-10-04 14:16:22 -0400
commit51b403bdcb9af76833a11a668cc9be0f49d62e72 (patch)
treee5e107242d868c67e9b3e107a26d76ba40b4fa0a
parent3e6ae1a4ae2f54ad70a528ee3d4fac992b964eaa (diff)
downloademacs-51b403bdcb9af76833a11a668cc9be0f49d62e72.tar.gz
emacs-51b403bdcb9af76833a11a668cc9be0f49d62e72.zip
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).
-rw-r--r--src/ChangeLog6
-rw-r--r--src/keyboard.c24
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 @@
12010-10-04 Chong Yidong <cyd@stupidchicken.com>
2
3 * keyboard.c (echo_prompt): Function moved into read_key_sequence.
4 (read_key_sequence): Inline echo_prompt.
5 (echo_dash): Add a dash only if key is continued (Bug#7137).
6
12010-10-04 Dan Nicolaescu <dann@ics.uci.edu> 72010-10-04 Dan Nicolaescu <dann@ics.uci.edu>
2 8
3 Remove O_RDONLY, O_WRONLY definitions, not needed. 9 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);
645static int cannot_suspend; 645static int cannot_suspend;
646 646
647 647
648/* Install the string STR as the beginning of the string of echoing,
649 so that it serves as a prompt for the next character.
650 Also start echoing. */
651
652void
653echo_prompt (Lisp_Object str)
654{
655 current_kboard->echo_string = str;
656 current_kboard->echo_after_prompt = SCHARS (str);
657 echo_now ();
658}
659
660/* Add C to the echo string, if echoing is going on. 648/* Add C to the echo string, if echoing is going on.
661 C can be a character, which is printed prettily ("M-C-x" and all that 649 C can be a character, which is printed prettily ("M-C-x" and all that
662 jazz), or a symbol, whose name is printed. */ 650 jazz), or a symbol, whose name is printed. */
@@ -755,6 +743,9 @@ echo_dash (void)
755 if (NILP (current_kboard->echo_string)) 743 if (NILP (current_kboard->echo_string))
756 return; 744 return;
757 745
746 if (this_command_key_count == 0)
747 return;
748
758 if (!current_kboard->immediate_echo 749 if (!current_kboard->immediate_echo
759 && SCHARS (current_kboard->echo_string) == 0) 750 && SCHARS (current_kboard->echo_string) == 0)
760 return; 751 return;
@@ -9125,7 +9116,14 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9125 if (INTERACTIVE) 9116 if (INTERACTIVE)
9126 { 9117 {
9127 if (!NILP (prompt)) 9118 if (!NILP (prompt))
9128 echo_prompt (prompt); 9119 {
9120 /* Install the string STR as the beginning of the string of
9121 echoing, so that it serves as a prompt for the next
9122 character. */
9123 current_kboard->echo_string = prompt;
9124 current_kboard->echo_after_prompt = SCHARS (prompt);
9125 echo_now ();
9126 }
9129 else if (cursor_in_echo_area 9127 else if (cursor_in_echo_area
9130 && (FLOATP (Vecho_keystrokes) || INTEGERP (Vecho_keystrokes)) 9128 && (FLOATP (Vecho_keystrokes) || INTEGERP (Vecho_keystrokes))
9131 && NILP (Fzerop (Vecho_keystrokes))) 9129 && NILP (Fzerop (Vecho_keystrokes)))