diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/xdisp.c | 49 |
2 files changed, 27 insertions, 25 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index c69452a1f1b..9a2cec8a7fc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -8,6 +8,9 @@ | |||
| 8 | (buffer_shared_and_changed): New function. | 8 | (buffer_shared_and_changed): New function. |
| 9 | (prepare_menu_bars, redisplay_internal): Use it to | 9 | (prepare_menu_bars, redisplay_internal): Use it to |
| 10 | decide whether all windows or frames should be updated. | 10 | decide whether all windows or frames should be updated. |
| 11 | (window_outdated): New function. | ||
| 12 | (text_outside_line_unchanged_p, redisplay_window): Use it. | ||
| 13 | (redisplay_internal): Likewise. Fix indentation. | ||
| 11 | 14 | ||
| 12 | 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca> | 15 | 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca> |
| 13 | 16 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index 618f4dfc585..4d359593c75 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -10888,7 +10888,7 @@ echo_area_display (int update_frame_p) | |||
| 10888 | return window_height_changed_p; | 10888 | return window_height_changed_p; |
| 10889 | } | 10889 | } |
| 10890 | 10890 | ||
| 10891 | /* True if the current buffer is shown in more than | 10891 | /* Nonzero if the current buffer is shown in more than |
| 10892 | one window and was modified since last display. */ | 10892 | one window and was modified since last display. */ |
| 10893 | 10893 | ||
| 10894 | static int | 10894 | static int |
| @@ -10897,6 +10897,17 @@ buffer_shared_and_changed (void) | |||
| 10897 | return (buffer_shared > 1 && UNCHANGED_MODIFIED < MODIFF); | 10897 | return (buffer_shared > 1 && UNCHANGED_MODIFIED < MODIFF); |
| 10898 | } | 10898 | } |
| 10899 | 10899 | ||
| 10900 | /* Nonzero if W doesn't reflect the actual state of | ||
| 10901 | current buffer due to its text or overlays change. */ | ||
| 10902 | |||
| 10903 | static int | ||
| 10904 | window_outdated (struct window *w) | ||
| 10905 | { | ||
| 10906 | eassert (XBUFFER (w->buffer) == current_buffer); | ||
| 10907 | return (w->last_modified < MODIFF | ||
| 10908 | || w->last_overlay_modified < OVERLAY_MODIFF); | ||
| 10909 | } | ||
| 10910 | |||
| 10900 | /*********************************************************************** | 10911 | /*********************************************************************** |
| 10901 | Mode Lines and Frame Titles | 10912 | Mode Lines and Frame Titles |
| 10902 | ***********************************************************************/ | 10913 | ***********************************************************************/ |
| @@ -12622,8 +12633,7 @@ text_outside_line_unchanged_p (struct window *w, | |||
| 12622 | int unchanged_p = 1; | 12633 | int unchanged_p = 1; |
| 12623 | 12634 | ||
| 12624 | /* If text or overlays have changed, see where. */ | 12635 | /* If text or overlays have changed, see where. */ |
| 12625 | if (w->last_modified < MODIFF | 12636 | if (window_outdated (w)) |
| 12626 | || w->last_overlay_modified < OVERLAY_MODIFF) | ||
| 12627 | { | 12637 | { |
| 12628 | /* Gap in the line? */ | 12638 | /* Gap in the line? */ |
| 12629 | if (GPT < start || Z - GPT < end) | 12639 | if (GPT < start || Z - GPT < end) |
| @@ -13134,9 +13144,7 @@ redisplay_internal (void) | |||
| 13134 | if (!NILP (w->column_number_displayed) | 13144 | if (!NILP (w->column_number_displayed) |
| 13135 | /* This alternative quickly identifies a common case | 13145 | /* This alternative quickly identifies a common case |
| 13136 | where no change is needed. */ | 13146 | where no change is needed. */ |
| 13137 | && !(PT == w->last_point | 13147 | && !(PT == w->last_point && !window_outdated (w)) |
| 13138 | && w->last_modified >= MODIFF | ||
| 13139 | && w->last_overlay_modified >= OVERLAY_MODIFF) | ||
| 13140 | && (XFASTINT (w->column_number_displayed) != current_column ())) | 13148 | && (XFASTINT (w->column_number_displayed) != current_column ())) |
| 13141 | w->update_mode_line = 1; | 13149 | w->update_mode_line = 1; |
| 13142 | 13150 | ||
| @@ -13198,18 +13206,16 @@ redisplay_internal (void) | |||
| 13198 | } | 13206 | } |
| 13199 | } | 13207 | } |
| 13200 | else if (EQ (selected_window, minibuf_window) | 13208 | else if (EQ (selected_window, minibuf_window) |
| 13201 | && (current_buffer->clip_changed | 13209 | && (current_buffer->clip_changed || window_outdated (w)) |
| 13202 | || w->last_modified < MODIFF | ||
| 13203 | || w->last_overlay_modified < OVERLAY_MODIFF) | ||
| 13204 | && resize_mini_window (w, 0)) | 13210 | && resize_mini_window (w, 0)) |
| 13205 | { | 13211 | { |
| 13206 | /* Resized active mini-window to fit the size of what it is | 13212 | /* Resized active mini-window to fit the size of what it is |
| 13207 | showing if its contents might have changed. */ | 13213 | showing if its contents might have changed. */ |
| 13208 | must_finish = 1; | 13214 | must_finish = 1; |
| 13209 | /* FIXME: this causes all frames to be updated, which seems unnecessary | 13215 | /* FIXME: this causes all frames to be updated, which seems unnecessary |
| 13210 | since only the current frame needs to be considered. This function needs | 13216 | since only the current frame needs to be considered. This function |
| 13211 | to be rewritten with two variables, consider_all_windows and | 13217 | needs to be rewritten with two variables, consider_all_windows and |
| 13212 | consider_all_frames. */ | 13218 | consider_all_frames. */ |
| 13213 | consider_all_windows_p = 1; | 13219 | consider_all_windows_p = 1; |
| 13214 | ++windows_or_buffers_changed; | 13220 | ++windows_or_buffers_changed; |
| 13215 | ++update_mode_lines; | 13221 | ++update_mode_lines; |
| @@ -13264,9 +13270,7 @@ redisplay_internal (void) | |||
| 13264 | || FETCH_BYTE (BYTEPOS (tlbufpos)) == '\n')) | 13270 | || FETCH_BYTE (BYTEPOS (tlbufpos)) == '\n')) |
| 13265 | /* Former continuation line has disappeared by becoming empty. */ | 13271 | /* Former continuation line has disappeared by becoming empty. */ |
| 13266 | goto cancel; | 13272 | goto cancel; |
| 13267 | else if (w->last_modified < MODIFF | 13273 | else if (window_outdated (w) || MINI_WINDOW_P (w)) |
| 13268 | || w->last_overlay_modified < OVERLAY_MODIFF | ||
| 13269 | || MINI_WINDOW_P (w)) | ||
| 13270 | { | 13274 | { |
| 13271 | /* We have to handle the case of continuation around a | 13275 | /* We have to handle the case of continuation around a |
| 13272 | wide-column character (see the comment in indent.c around | 13276 | wide-column character (see the comment in indent.c around |
| @@ -15517,8 +15521,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 15517 | = (!NILP (w->window_end_valid) | 15521 | = (!NILP (w->window_end_valid) |
| 15518 | && !current_buffer->clip_changed | 15522 | && !current_buffer->clip_changed |
| 15519 | && !current_buffer->prevent_redisplay_optimizations_p | 15523 | && !current_buffer->prevent_redisplay_optimizations_p |
| 15520 | && w->last_modified >= MODIFF | 15524 | && !window_outdated (w)); |
| 15521 | && w->last_overlay_modified >= OVERLAY_MODIFF); | ||
| 15522 | 15525 | ||
| 15523 | /* Run the window-bottom-change-functions | 15526 | /* Run the window-bottom-change-functions |
| 15524 | if it is possible that the text on the screen has changed | 15527 | if it is possible that the text on the screen has changed |
| @@ -15540,8 +15543,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 15540 | buffer_unchanged_p | 15543 | buffer_unchanged_p |
| 15541 | = (!NILP (w->window_end_valid) | 15544 | = (!NILP (w->window_end_valid) |
| 15542 | && !current_buffer->clip_changed | 15545 | && !current_buffer->clip_changed |
| 15543 | && w->last_modified >= MODIFF | 15546 | && !window_outdated (w)); |
| 15544 | && w->last_overlay_modified >= OVERLAY_MODIFF); | ||
| 15545 | 15547 | ||
| 15546 | /* When windows_or_buffers_changed is non-zero, we can't rely on | 15548 | /* When windows_or_buffers_changed is non-zero, we can't rely on |
| 15547 | the window end being valid, so set it to nil there. */ | 15549 | the window end being valid, so set it to nil there. */ |
| @@ -15566,9 +15568,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 15566 | if (!NILP (w->column_number_displayed) | 15568 | if (!NILP (w->column_number_displayed) |
| 15567 | /* This alternative quickly identifies a common case | 15569 | /* This alternative quickly identifies a common case |
| 15568 | where no change is needed. */ | 15570 | where no change is needed. */ |
| 15569 | && !(PT == w->last_point | 15571 | && !(PT == w->last_point && !window_outdated (w)) |
| 15570 | && w->last_modified >= MODIFF | ||
| 15571 | && w->last_overlay_modified >= OVERLAY_MODIFF) | ||
| 15572 | && (XFASTINT (w->column_number_displayed) != current_column ())) | 15572 | && (XFASTINT (w->column_number_displayed) != current_column ())) |
| 15573 | update_mode_line = 1; | 15573 | update_mode_line = 1; |
| 15574 | 15574 | ||
| @@ -15810,8 +15810,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 15810 | && (CHARPOS (startp) < ZV | 15810 | && (CHARPOS (startp) < ZV |
| 15811 | /* Avoid starting at end of buffer. */ | 15811 | /* Avoid starting at end of buffer. */ |
| 15812 | || CHARPOS (startp) == BEGV | 15812 | || CHARPOS (startp) == BEGV |
| 15813 | || (w->last_modified >= MODIFF | 15813 | || !window_outdated (w))) |
| 15814 | && w->last_overlay_modified >= OVERLAY_MODIFF))) | ||
| 15815 | { | 15814 | { |
| 15816 | int d1, d2, d3, d4, d5, d6; | 15815 | int d1, d2, d3, d4, d5, d6; |
| 15817 | 15816 | ||