diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2013-01-22 15:41:21 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2013-01-22 15:41:21 +0400 |
commit | 1dcb8ea26301d187273787450fda118f5fc3c1a6 (patch) | |
tree | 038efe92f3d1b5f53c4ab10c470d7bfd177310e7 /src/xdisp.c | |
parent | 19b50424a7e6801a8f96dbab422f70ade95b5825 (diff) | |
download | emacs-1dcb8ea26301d187273787450fda118f5fc3c1a6.tar.gz |
* xdisp.c (mark_window_display_accurate): Simplify the loop
assuming that the only one of vchild, hchild or buffer window
slots is non-nil. Call mark_window_display_accurate_1 for
the leaf windows only.
(mark_window_display_accurate_1): Always assume leaf window.
Adjust comment.
Diffstat (limited to 'src/xdisp.c')
-rw-r--r-- | src/xdisp.c | 77 |
1 files changed, 33 insertions, 44 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index b75362b1446..69a8a02b2cb 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13722,49 +13722,42 @@ unwind_redisplay (Lisp_Object old_frame) } -/* Mark the display of window W as accurate or inaccurate. If - ACCURATE_P is non-zero mark display of W as accurate. If - ACCURATE_P is zero, arrange for W to be redisplayed the next time - redisplay_internal is called. */ +/* Mark the display of leaf window W as accurate or inaccurate. + If ACCURATE_P is non-zero mark display of W as accurate. If + ACCURATE_P is zero, arrange for W to be redisplayed the next + time redisplay_internal is called. */ static void mark_window_display_accurate_1 (struct window *w, int accurate_p) { - if (BUFFERP (w->buffer)) - { - struct buffer *b = XBUFFER (w->buffer); + struct buffer *b = XBUFFER (w->buffer); - w->last_modified = accurate_p ? BUF_MODIFF (b) : 0; - w->last_overlay_modified = accurate_p ? BUF_OVERLAY_MODIFF (b) : 0; - w->last_had_star - = BUF_MODIFF (b) > BUF_SAVE_MODIFF (b); + w->last_modified = accurate_p ? BUF_MODIFF (b) : 0; + w->last_overlay_modified = accurate_p ? BUF_OVERLAY_MODIFF (b) : 0; + w->last_had_star = BUF_MODIFF (b) > BUF_SAVE_MODIFF (b); - if (accurate_p) - { - b->clip_changed = 0; - b->prevent_redisplay_optimizations_p = 0; + if (accurate_p) + { + b->clip_changed = 0; + b->prevent_redisplay_optimizations_p = 0; - BUF_UNCHANGED_MODIFIED (b) = BUF_MODIFF (b); - BUF_OVERLAY_UNCHANGED_MODIFIED (b) = BUF_OVERLAY_MODIFF (b); - BUF_BEG_UNCHANGED (b) = BUF_GPT (b) - BUF_BEG (b); - BUF_END_UNCHANGED (b) = BUF_Z (b) - BUF_GPT (b); + BUF_UNCHANGED_MODIFIED (b) = BUF_MODIFF (b); + BUF_OVERLAY_UNCHANGED_MODIFIED (b) = BUF_OVERLAY_MODIFF (b); + BUF_BEG_UNCHANGED (b) = BUF_GPT (b) - BUF_BEG (b); + BUF_END_UNCHANGED (b) = BUF_Z (b) - BUF_GPT (b); - w->current_matrix->buffer = b; - w->current_matrix->begv = BUF_BEGV (b); - w->current_matrix->zv = BUF_ZV (b); + w->current_matrix->buffer = b; + w->current_matrix->begv = BUF_BEGV (b); + w->current_matrix->zv = BUF_ZV (b); - w->last_cursor = w->cursor; - w->last_cursor_off_p = w->cursor_off_p; + w->last_cursor = w->cursor; + w->last_cursor_off_p = w->cursor_off_p; - if (w == XWINDOW (selected_window)) - w->last_point = BUF_PT (b); - else - w->last_point = marker_position (w->pointm); - } - } + if (w == XWINDOW (selected_window)) + w->last_point = BUF_PT (b); + else + w->last_point = marker_position (w->pointm); - if (accurate_p) - { wset_window_end_valid (w, w->buffer); w->update_mode_line = 0; } @@ -13784,25 +13777,21 @@ mark_window_display_accurate (Lisp_Object window, int accurate_p) for (; !NILP (window); window = w->next) { w = XWINDOW (window); - mark_window_display_accurate_1 (w, accurate_p); - if (!NILP (w->vchild)) mark_window_display_accurate (w->vchild, accurate_p); - if (!NILP (w->hchild)) + else if (!NILP (w->hchild)) mark_window_display_accurate (w->hchild, accurate_p); + else if (BUFFERP (w->buffer)) + mark_window_display_accurate_1 (w, accurate_p); } if (accurate_p) - { - update_overlay_arrows (1); - } + update_overlay_arrows (1); else - { - /* Force a thorough redisplay the next time by setting - last_arrow_position and last_arrow_string to t, which is - unequal to any useful value of Voverlay_arrow_... */ - update_overlay_arrows (-1); - } + /* Force a thorough redisplay the next time by setting + last_arrow_position and last_arrow_string to t, which is + unequal to any useful value of Voverlay_arrow_... */ + update_overlay_arrows (-1); } |