2001-05-11 Gerd Moellmann <gerd@gnu.org>
+ * xdisp.c (try_window_id): Fix computation of window end in
+ the case that lines were deleted at the end of the window.
+ Add some more debug_method_adds.
+
* xfaces.c (try_alternative_families): New function.
(try_font_list): Use it. If ATTRS specifies a family, check
fonts from that family first.
w->window_end_vpos
= make_number (MATRIX_ROW_VPOS (row, w->current_matrix));
xassert (w->window_end_bytepos >= 0);
+ IF_DEBUG (debug_method_add (w, "A"));
}
else if (last_text_row_at_end)
{
w->window_end_vpos
= make_number (MATRIX_ROW_VPOS (last_text_row_at_end, desired_matrix));
xassert (w->window_end_bytepos >= 0);
+ IF_DEBUG (debug_method_add (w, "B"));
}
else if (last_text_row)
{
{
/* Displayed to end of window, but no line containing text was
displayed. Lines were deleted at the end of the window. */
- int vpos;
- int header_line_p = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0;
-
- for (vpos = XFASTINT (w->window_end_vpos); vpos > 0; --vpos)
- if ((w->desired_matrix->rows[vpos + header_line_p].enabled_p
- && w->desired_matrix->rows[vpos + header_line_p].displays_text_p)
- || (!w->desired_matrix->rows[vpos + header_line_p].enabled_p
- && w->current_matrix->rows[vpos + header_line_p].displays_text_p))
- break;
+ int first_vpos = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0;
+ int vpos = XFASTINT (w->window_end_vpos);
+ struct glyph_row *current_row = current_matrix->rows + vpos;
+ struct glyph_row *desired_row = desired_matrix->rows + vpos;
+
+ for (row = NULL;
+ row == NULL && vpos >= first_vpos;
+ --vpos, --current_row, --desired_row)
+ {
+ if (desired_row->enabled_p)
+ {
+ if (desired_row->displays_text_p)
+ row = desired_row;
+ }
+ else if (current_row->displays_text_p)
+ row = current_row;
+ }
+ xassert (row != NULL);
w->window_end_vpos = make_number (vpos);
- row = MATRIX_ROW (w->desired_matrix, vpos);
w->window_end_pos = make_number (Z - MATRIX_ROW_END_CHARPOS (row));
w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row);
xassert (w->window_end_bytepos >= 0);
+ IF_DEBUG (debug_method_add (w, "C"));
}
else
abort ();