diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index fee87273d1e..9c15313efa3 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -567,21 +567,12 @@ Lisp_Object Vmessage_log_max; | |||
| 567 | 567 | ||
| 568 | static Lisp_Object Vmessages_buffer_name; | 568 | static Lisp_Object Vmessages_buffer_name; |
| 569 | 569 | ||
| 570 | /* Index 0 is the buffer that holds the current (desired) echo area message, | 570 | /* Current, index 0, and last displayed echo area message. Either |
| 571 | or nil if none is desired right now. | 571 | buffers from echo_buffers, or nil to indicate no message. */ |
| 572 | |||
| 573 | Index 1 is the buffer that holds the previously displayed echo area message, | ||
| 574 | or nil to indicate no message. This is normally what's on the screen now. | ||
| 575 | |||
| 576 | These two can point to the same buffer. That happens when the last | ||
| 577 | message output by the user (or made by echoing) has been displayed. */ | ||
| 578 | 572 | ||
| 579 | Lisp_Object echo_area_buffer[2]; | 573 | Lisp_Object echo_area_buffer[2]; |
| 580 | 574 | ||
| 581 | /* Permanent pointers to the two buffers that are used for echo area | 575 | /* The buffers referenced from echo_area_buffer. */ |
| 582 | purposes. Once the two buffers are made, and their pointers are | ||
| 583 | placed here, these two slots remain unchanged unless those buffers | ||
| 584 | need to be created afresh. */ | ||
| 585 | 576 | ||
| 586 | static Lisp_Object echo_buffer[2]; | 577 | static Lisp_Object echo_buffer[2]; |
| 587 | 578 | ||
| @@ -7231,6 +7222,10 @@ ensure_echo_area_buffers () | |||
| 7231 | WHICH > 0 means use echo_area_buffer[1]. If that is nil, choose a | 7222 | WHICH > 0 means use echo_area_buffer[1]. If that is nil, choose a |
| 7232 | suitable buffer from echo_buffer[] and clear it. | 7223 | suitable buffer from echo_buffer[] and clear it. |
| 7233 | 7224 | ||
| 7225 | If WHICH < 0, set echo_area_buffer[1] to echo_area_buffer[0], so | ||
| 7226 | that the current message becomes the last displayed one, make | ||
| 7227 | choose a suitable buffer for echo_area_buffer[0], and clear it. | ||
| 7228 | |||
| 7234 | Value is what FN returns. */ | 7229 | Value is what FN returns. */ |
| 7235 | 7230 | ||
| 7236 | static int | 7231 | static int |
| @@ -7255,6 +7250,17 @@ with_echo_area_buffer (w, which, fn, a1, a2, a3, a4) | |||
| 7255 | this_one = 0, the_other = 1; | 7250 | this_one = 0, the_other = 1; |
| 7256 | else if (which > 0) | 7251 | else if (which > 0) |
| 7257 | this_one = 1, the_other = 0; | 7252 | this_one = 1, the_other = 0; |
| 7253 | else | ||
| 7254 | { | ||
| 7255 | this_one = 0, the_other = 1; | ||
| 7256 | clear_buffer_p = 1; | ||
| 7257 | |||
| 7258 | /* We need a fresh one in case the current echo buffer equals | ||
| 7259 | the one containing the last displayed echo area message. */ | ||
| 7260 | if (!NILP (echo_area_buffer[this_one]) | ||
| 7261 | && EQ (echo_area_buffer[this_one], echo_area_buffer[the_other])) | ||
| 7262 | echo_area_buffer[this_one] = Qnil; | ||
| 7263 | } | ||
| 7258 | 7264 | ||
| 7259 | /* Choose a suitable buffer from echo_buffer[] is we don't | 7265 | /* Choose a suitable buffer from echo_buffer[] is we don't |
| 7260 | have one. */ | 7266 | have one. */ |
| @@ -7874,7 +7880,7 @@ set_message (s, string, nbytes, multibyte_p) | |||
| 7874 | = ((s && multibyte_p) | 7880 | = ((s && multibyte_p) |
| 7875 | || (STRINGP (string) && STRING_MULTIBYTE (string))); | 7881 | || (STRINGP (string) && STRING_MULTIBYTE (string))); |
| 7876 | 7882 | ||
| 7877 | with_echo_area_buffer (0, 0, set_message_1, | 7883 | with_echo_area_buffer (0, -1, set_message_1, |
| 7878 | (EMACS_INT) s, string, nbytes, multibyte_p); | 7884 | (EMACS_INT) s, string, nbytes, multibyte_p); |
| 7879 | message_buf_print = 0; | 7885 | message_buf_print = 0; |
| 7880 | help_echo_showing_p = 0; | 7886 | help_echo_showing_p = 0; |
| @@ -7906,7 +7912,6 @@ set_message_1 (a1, a2, nbytes, multibyte_p) | |||
| 7906 | 7912 | ||
| 7907 | /* Insert new message at BEG. */ | 7913 | /* Insert new message at BEG. */ |
| 7908 | TEMP_SET_PT_BOTH (BEG, BEG_BYTE); | 7914 | TEMP_SET_PT_BOTH (BEG, BEG_BYTE); |
| 7909 | Ferase_buffer (); | ||
| 7910 | 7915 | ||
| 7911 | if (STRINGP (string)) | 7916 | if (STRINGP (string)) |
| 7912 | { | 7917 | { |
| @@ -8122,8 +8127,10 @@ echo_area_display (update_frame_p) | |||
| 8122 | else if (!EQ (mini_window, selected_window)) | 8127 | else if (!EQ (mini_window, selected_window)) |
| 8123 | windows_or_buffers_changed++; | 8128 | windows_or_buffers_changed++; |
| 8124 | 8129 | ||
| 8125 | /* The current message is now also the last one displayed. */ | 8130 | /* Last displayed message is now the current message. */ |
| 8126 | echo_area_buffer[1] = echo_area_buffer[0]; | 8131 | echo_area_buffer[1] = echo_area_buffer[0]; |
| 8132 | /* Inform read_char that we're not echoing. */ | ||
| 8133 | echo_message_buffer = Qnil; | ||
| 8127 | 8134 | ||
| 8128 | /* Prevent redisplay optimization in redisplay_internal by resetting | 8135 | /* Prevent redisplay optimization in redisplay_internal by resetting |
| 8129 | this_line_start_pos. This is done because the mini-buffer now | 8136 | this_line_start_pos. This is done because the mini-buffer now |