diff options
| author | Stefan Monnier | 2016-02-24 15:50:54 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2016-02-24 15:50:54 -0500 |
| commit | 5244db29158aed4b3430329cbc48c1c925e1c36a (patch) | |
| tree | b9f94394e500d91a27df9548e6ce7d2a07c317de /src | |
| parent | 9d0b103a45dc3e855bae8cb727797279021131fd (diff) | |
| download | emacs-5244db29158aed4b3430329cbc48c1c925e1c36a.tar.gz emacs-5244db29158aed4b3430329cbc48c1c925e1c36a.zip | |
* src/keyboard.c: Don't inadvertently set immediate_echo (bug#22581)
* src/keyboard.c (read_key_sequence): Don't inadvertently set
immediate_echo when we don't want any echo-keystrokes.
(echo_keystrokes_p): Move earlier.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index ef86e69bf91..298ab644ab1 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -427,6 +427,15 @@ kset_system_key_syms (struct kboard *kb, Lisp_Object val) | |||
| 427 | } | 427 | } |
| 428 | 428 | ||
| 429 | 429 | ||
| 430 | static bool | ||
| 431 | echo_keystrokes_p (void) | ||
| 432 | { | ||
| 433 | return (!cursor_in_echo_area) | ||
| 434 | && (FLOATP (Vecho_keystrokes) ? XFLOAT_DATA (Vecho_keystrokes) > 0.0 | ||
| 435 | : INTEGERP (Vecho_keystrokes) ? XINT (Vecho_keystrokes) > 0 | ||
| 436 | : false); | ||
| 437 | } | ||
| 438 | |||
| 430 | /* Add C to the echo string, without echoing it immediately. C can be | 439 | /* Add C to the echo string, without echoing it immediately. C can be |
| 431 | a character, which is pretty-printed, or a symbol, whose name is | 440 | a character, which is pretty-printed, or a symbol, whose name is |
| 432 | printed. */ | 441 | printed. */ |
| @@ -568,7 +577,9 @@ echo_update (void) | |||
| 568 | static void | 577 | static void |
| 569 | echo_now (void) | 578 | echo_now (void) |
| 570 | { | 579 | { |
| 571 | if (!current_kboard->immediate_echo) | 580 | if (!current_kboard->immediate_echo |
| 581 | /* This test breaks calls that use `echo_now' to display the echo_prompt. | ||
| 582 | && echo_keystrokes_p () */) | ||
| 572 | { | 583 | { |
| 573 | current_kboard->immediate_echo = true; | 584 | current_kboard->immediate_echo = true; |
| 574 | echo_update (); | 585 | echo_update (); |
| @@ -2270,13 +2281,6 @@ read_decoded_event_from_main_queue (struct timespec *end_time, | |||
| 2270 | } | 2281 | } |
| 2271 | } | 2282 | } |
| 2272 | 2283 | ||
| 2273 | static bool | ||
| 2274 | echo_keystrokes_p (void) | ||
| 2275 | { | ||
| 2276 | return (FLOATP (Vecho_keystrokes) ? XFLOAT_DATA (Vecho_keystrokes) > 0.0 | ||
| 2277 | : INTEGERP (Vecho_keystrokes) ? XINT (Vecho_keystrokes) > 0 : false); | ||
| 2278 | } | ||
| 2279 | |||
| 2280 | /* Read a character from the keyboard; call the redisplay if needed. */ | 2284 | /* Read a character from the keyboard; call the redisplay if needed. */ |
| 2281 | /* commandflag 0 means do not autosave, but do redisplay. | 2285 | /* commandflag 0 means do not autosave, but do redisplay. |
| 2282 | -1 means do not redisplay, but do autosave. | 2286 | -1 means do not redisplay, but do autosave. |
| @@ -8890,11 +8894,15 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 8890 | of echoing, so that it serves as a prompt for the next | 8894 | of echoing, so that it serves as a prompt for the next |
| 8891 | character. */ | 8895 | character. */ |
| 8892 | kset_echo_prompt (current_kboard, prompt); | 8896 | kset_echo_prompt (current_kboard, prompt); |
| 8897 | /* FIXME: This use of echo_now doesn't look quite right and is ugly | ||
| 8898 | since it forces us to fiddle with current_kboard->immediate_echo | ||
| 8899 | before and after. */ | ||
| 8893 | current_kboard->immediate_echo = false; | 8900 | current_kboard->immediate_echo = false; |
| 8894 | echo_now (); | 8901 | echo_now (); |
| 8902 | if (!echo_keystrokes_p ()) | ||
| 8903 | current_kboard->immediate_echo = false; | ||
| 8895 | } | 8904 | } |
| 8896 | else if (cursor_in_echo_area | 8905 | else if (echo_keystrokes_p ()) |
| 8897 | && echo_keystrokes_p ()) | ||
| 8898 | /* This doesn't put in a dash if the echo buffer is empty, so | 8906 | /* This doesn't put in a dash if the echo buffer is empty, so |
| 8899 | you don't always see a dash hanging out in the minibuffer. */ | 8907 | you don't always see a dash hanging out in the minibuffer. */ |
| 8900 | echo_dash (); | 8908 | echo_dash (); |