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.
+2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * 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.
+
2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
* xdisp.c (mark_window_display_accurate): Simplify the loop
are invalidated below. */
if (INTEGERP (w->window_end_vpos)
&& XFASTINT (w->window_end_vpos) >= i)
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
while (i < matrix->nrows)
matrix->rows[i++].enabled_p = 0;
else
{
clear_glyph_matrix (w->current_matrix);
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
}
}
b = b->base_buffer;
b->window_count += arg;
eassert (b->window_count >= 0);
+ /* Catch redisplay's attention. */
+ w->window_end_valid = 0;
}
}
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;
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)
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;
}
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
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
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. */
/* 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;
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)));
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)));
no scroll bar. A value of t means use frame value. */
Lisp_Object vertical_scroll_bar_type;
- /* Z - the buffer position of the last glyph in the current matrix
- of W. Only valid if WINDOW_END_VALID is not nil. */
+ /* Z - the buffer position of the last glyph in the current
+ matrix of W. Only valid if window_end_valid is nonzero. */
Lisp_Object window_end_pos;
+
/* Glyph matrix row of the last glyph in the current matrix
- of W. Only valid if WINDOW_END_VALID is not nil. */
+ of W. Only valid if window_end_valid is nonzero. */
Lisp_Object window_end_vpos;
- /* t if window_end_pos is truly valid.
- This is nil if nontrivial redisplay is preempted
- since in that case the frame image that window_end_pos
- did not get onto the frame. */
- Lisp_Object window_end_valid;
/* Display-table to use for displaying chars in this window.
Nil means use the buffer's own display-table. */
Otherwise draw them between margin areas and text. */
unsigned fringes_outside_margins : 1;
+ /* Nonzero if window_end_pos and window_end_vpos are truly valid.
+ This is zero if nontrivial redisplay is preempted since in that case
+ the frame image that window_end_pos did not get onto the frame. */
+ unsigned window_end_valid : 1;
+
/* Amount by which lines of this window are scrolled in
y-direction (smooth scrolling). */
int vscroll;
- /* Z_BYTE - Buffer position of the last glyph in the current matrix of W.
- Should be nonnegative, and only valid if window_end_valid is not nil. */
+ /* Z_BYTE - buffer position of the last glyph in the current matrix of W.
+ Should be nonnegative, and only valid if window_end_valid is nonzero. */
ptrdiff_t window_end_bytepos;
};
w->window_end_pos = val;
}
WINDOW_INLINE void
-wset_window_end_valid (struct window *w, Lisp_Object val)
-{
- w->window_end_valid = val;
-}
-WINDOW_INLINE void
wset_window_end_vpos (struct window *w, Lisp_Object val)
{
w->window_end_vpos = val;
static void
check_window_end (struct window *w)
{
- if (!MINI_WINDOW_P (w)
- && !NILP (w->window_end_valid))
+ if (!MINI_WINDOW_P (w) && w->window_end_valid)
{
struct glyph_row *row;
eassert ((row = MATRIX_ROW (w->current_matrix,
reconsider_clip_changes (struct window *w, struct buffer *b)
{
if (b->clip_changed
- && !NILP (w->window_end_valid)
- && w->current_matrix->buffer == b
- && w->current_matrix->zv == BUF_ZV (b)
- && w->current_matrix->begv == BUF_BEGV (b))
+ && w->window_end_valid
+ && w->current_matrix->buffer == b
+ && w->current_matrix->zv == BUF_ZV (b)
+ && w->current_matrix->begv == BUF_BEGV (b))
b->clip_changed = 0;
/* If display wasn't paused, and W is not a tool bar window, see if
we set b->clip_changed to 1 to force updating the screen. If
b->clip_changed has already been set to 1, we can skip this
check. */
- if (!b->clip_changed
- && BUFFERP (w->buffer) && !NILP (w->window_end_valid))
+ if (!b->clip_changed && BUFFERP (w->buffer) && w->window_end_valid)
{
ptrdiff_t pt;
else if (XFASTINT (w->window_end_vpos) == this_line_vpos
&& this_line_vpos > 0)
wset_window_end_vpos (w, make_number (this_line_vpos - 1));
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
/* Update hint: No need to try to scroll in update_window. */
w->desired_matrix->no_scrolling_p = 1;
else
w->last_point = marker_position (w->pointm);
- wset_window_end_valid (w, w->buffer);
+ w->window_end_valid = 1;
w->update_mode_line = 0;
}
}
set_buffer_internal_1 (XBUFFER (w->buffer));
current_matrix_up_to_date_p
- = (!NILP (w->window_end_valid)
+ = (w->window_end_valid
&& !current_buffer->clip_changed
&& !current_buffer->prevent_redisplay_optimizations_p
&& !window_outdated (w));
specbind (Qinhibit_point_motion_hooks, Qt);
buffer_unchanged_p
- = (!NILP (w->window_end_valid)
+ = (w->window_end_valid
&& !current_buffer->clip_changed
&& !window_outdated (w));
if (XMARKER (w->start)->buffer == current_buffer)
compute_window_start_on_continuation_line (w);
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
}
/* Some sanity checks. */
w->force_start = 0;
w->vscroll = 0;
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
/* Forget any recorded base line for line number display. */
if (!buffer_unchanged_p)
line.) */
if (w->cursor.vpos < 0)
{
- if (!NILP (w->window_end_valid)
- && PT >= Z - XFASTINT (w->window_end_pos))
+ if (w->window_end_valid && PT >= Z - XFASTINT (w->window_end_pos))
{
clear_glyph_matrix (w->desired_matrix);
move_it_by_lines (&it, 1);
}
/* But that is not valid info until redisplay finishes. */
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
return 1;
}
wset_window_end_pos (w, make_number (Z - ZV));
wset_window_end_vpos (w, make_number (0));
}
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
/* Update hint: don't try scrolling again in update_window. */
w->desired_matrix->no_scrolling_p = 1;
(w, make_number (XFASTINT (w->window_end_vpos) - nrows_scrolled));
}
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
w->desired_matrix->no_scrolling_p = 1;
#ifdef GLYPH_DEBUG
/* Display must not have been paused, otherwise the current matrix
is not up to date. */
- eassert (!NILP (w->window_end_valid));
+ eassert (w->window_end_valid);
/* A value of window_end_pos >= END_UNCHANGED means that the window
end is in the range of changed text. If so, there is no
/* Try to redisplay window W by reusing its existing display. W's
current matrix must be up to date when this function is called,
- i.e. window_end_valid must not be nil.
+ i.e. window_end_valid must be nonzero.
Value is
GIVE_UP (7);
/* Verify that display wasn't paused. */
- if (NILP (w->window_end_valid))
+ if (!w->window_end_valid)
GIVE_UP (8);
/* Can't use this if highlighting a region because a cursor movement
debug_end_vpos = XFASTINT (w->window_end_vpos));
/* Record that display has not been completed. */
- wset_window_end_valid (w, Qnil);
+ w->window_end_valid = 0;
w->desired_matrix->no_scrolling_p = 1;
return 3;
And verify the buffer's text has not changed. */
b = XBUFFER (w->buffer);
if (part == ON_TEXT
- && EQ (w->window_end_valid, w->buffer)
+ && w->window_end_valid
&& w->last_modified == BUF_MODIFF (b)
&& w->last_overlay_modified == BUF_OVERLAY_MODIFF (b))
{