diff options
| author | Chong Yidong | 2010-10-04 14:16:22 -0400 |
|---|---|---|
| committer | Chong Yidong | 2010-10-04 14:16:22 -0400 |
| commit | 51b403bdcb9af76833a11a668cc9be0f49d62e72 (patch) | |
| tree | e5e107242d868c67e9b3e107a26d76ba40b4fa0a | |
| parent | 3e6ae1a4ae2f54ad70a528ee3d4fac992b964eaa (diff) | |
| download | emacs-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/ChangeLog | 6 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | 2010-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 | |||
| 1 | 2010-10-04 Dan Nicolaescu <dann@ics.uci.edu> | 7 | 2010-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); | |||
| 645 | static int cannot_suspend; | 645 | static 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 | |||
| 652 | void | ||
| 653 | echo_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))) |