From 9d93ce29bdf8aa277123170ef37f942f87e5073b Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Tue, 22 Jan 2013 15:48:00 +0400 Subject: * window.h (struct window): Change window_end_valid member from Lisp_Object to a bitfield. Adjust comments. (wset_window_end_valid): Remove. * window.c (adjust_window_count): Clear window_end_valid. (Fwindow_end): Adjust user. Remove ancient #if 0 code. (Fwindow_line_height, set_window_buffer, Frecenter) (Fsplit_window_internal, Fdelete_other_windows_internal) (Fset_window_fringes, Fset_window_scroll_bars): Adjust users. * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise. * xdisp.c (check_window_end, reconsider_clip_changes) (redisplay_internal, mark_window_display_accurate_1, redisplay_window) (try_window, try_window_reusing_current_matrix, note_mouse_highlight) (find_first_unchanged_at_end_row, try_window_id): Likewise. --- src/window.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) (limited to 'src/window.c') diff --git a/src/window.c b/src/window.c index e60b9e8967d..db00bc26482 100644 --- a/src/window.c +++ b/src/window.c @@ -286,6 +286,8 @@ adjust_window_count (struct window *w, int arg) b = b->base_buffer; b->window_count += arg; eassert (b->window_count >= 0); + /* Catch redisplay's attention. */ + w->window_end_valid = 0; } } @@ -1489,17 +1491,8 @@ if it isn't already recorded. */) CHECK_BUFFER (buf); b = XBUFFER (buf); -#if 0 /* This change broke some things. We should make it later. */ - /* If we don't know the end position, return nil. - The user can compute it with vertical-motion if he wants to. - It would be nicer to do it automatically, - but that's so slow that it would probably bother people. */ - if (NILP (w->window_end_valid)) - return Qnil; -#endif - if (! NILP (update) - && (windows_or_buffers_changed || NILP (w->window_end_valid)) + && (windows_or_buffers_changed || !w->window_end_valid) && !noninteractive) { struct text_pos startp; @@ -1706,7 +1699,7 @@ Return nil if window display is not up-to-date. In that case, use b = XBUFFER (w->buffer); /* Fail if current matrix is not up-to-date. */ - if (NILP (w->window_end_valid) + if (!w->window_end_valid || current_buffer->clip_changed || current_buffer->prevent_redisplay_optimizations_p || w->last_modified < BUF_MODIFF (b) @@ -2038,7 +2031,7 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag) n->pseudo_window_p = 0; wset_window_end_vpos (n, make_number (0)); wset_window_end_pos (n, make_number (0)); - wset_window_end_valid (n, Qnil); + n->window_end_valid = 0; n->frozen_window_start_p = 0; } @@ -2973,7 +2966,7 @@ window-start value is reasonable when this function is called. */) pos = *vmotion (startpos, -top, w); set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos); - wset_window_end_valid (w, Qnil); + w->window_end_valid = 0; w->start_at_line_beg = (pos.bytepos == BEGV_BYTE || FETCH_BYTE (pos.bytepos - 1) == '\n'); /* We need to do this, so that the window-scroll-functions @@ -3189,7 +3182,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int wset_window_end_pos (w, make_number (0)); wset_window_end_vpos (w, make_number (0)); memset (&w->last_cursor, 0, sizeof w->last_cursor); - wset_window_end_valid (w, Qnil); + if (!(keep_margins_p && samebuf)) { /* If we're not actually changing the buffer, don't reset hscroll and vscroll. This case happens for example when called from @@ -3958,7 +3951,7 @@ set correctly. See the code of `split-window' for how this is done. */) wset_next (o, new); } - wset_window_end_valid (n, Qnil); + n->window_end_valid = 0; memset (&n->last_cursor, 0, sizeof n->last_cursor); /* Get special geometry settings from reference window. */ @@ -5368,7 +5361,7 @@ and redisplay normally--don't erase and redraw the frame. */) /* Set the new window start. */ set_marker_both (w->start, w->buffer, charpos, bytepos); - wset_window_end_valid (w, Qnil); + w->window_end_valid = 0; w->optional_new_start = 1; @@ -6319,7 +6312,7 @@ display marginal areas and the text area. */) adjust_window_margins (w); clear_glyph_matrix (w->current_matrix); - wset_window_end_valid (w, Qnil); + w->window_end_valid = 0; ++windows_or_buffers_changed; adjust_glyphs (XFRAME (WINDOW_FRAME (w))); @@ -6389,7 +6382,7 @@ Fourth parameter HORIZONTAL-TYPE is currently unused. */) adjust_window_margins (w); clear_glyph_matrix (w->current_matrix); - wset_window_end_valid (w, Qnil); + w->window_end_valid = 0; ++windows_or_buffers_changed; adjust_glyphs (XFRAME (WINDOW_FRAME (w))); -- cgit v1.2.1