it->current_x = it->hpos = 0;
}
}
-
-#if 0 /* Don't assert the following because start_display is sometimes
- called intentionally with a window start that is not at a
- line start. Please leave this code in as a comment. */
-
- /* Window start should be on a line start, now. */
- xassert (it->continuation_lines_width
- || IT_CHARPOS (it) == BEGV
- || FETCH_BYTE (IT_BYTEPOS (it) - 1) == '\n');
-#endif /* 0 */
}
&next_stop,
base_face_id, 0);
-#if 0 /* This shouldn't be neccessary. Let's check it. */
- /* If IT is used to display a mode line we would really like to
- use the mode line face instead of the frame's default face. */
- if (it->glyph_row == MATRIX_MODE_LINE_ROW (it->w->desired_matrix)
- && new_face_id == DEFAULT_FACE_ID)
- new_face_id = CURRENT_MODE_LINE_FACE_ID (it->w);
-#endif
-
/* Is this a start of a run of characters with box? Caveat:
this can be called for a freshly allocated iterator; face_id
is -1 is this case. We know that the new face will not
if (success_p && it->dpvec == NULL)
{
Lisp_Object dv;
+ struct charset *unibyte = CHARSET_FROM_ID (charset_unibyte);
if (it->dp
&& (dv = DISP_CHAR_VECTOR (it->dp, it->c),
|| it->c == 0xAD /* SOFT HYPHEN */)))
: (it->c >= 127
&& (! unibyte_display_via_language_environment
- || (UNIBYTE_CHAR_HAS_MULTIBYTE_P (it->c)))))))
+ || (DECODE_CHAR (unibyte, it->c) <= 0xA0))))))
{
/* IT->c is a control character which must be displayed
either as '\003' or as `^C' where the '\\' and '^'
int op;
{
enum move_it_result skip, skip2 = MOVE_X_REACHED;
- int line_height;
- int reached = 0;
+ int line_height, line_start_x = 0, reached = 0;
for (;;)
{
if (it->current_x != it->last_visible_x
&& (op & MOVE_TO_VPOS)
&& !(op & (MOVE_TO_X | MOVE_TO_POS)))
- set_iterator_to_next (it, 0);
+ {
+ line_start_x = it->current_x + it->pixel_width
+ - it->last_visible_x;
+ set_iterator_to_next (it, 0);
+ }
}
else
it->continuation_lines_width += it->current_x;
/* Reset/increment for the next run. */
recenter_overlay_lists (current_buffer, IT_CHARPOS (*it));
- it->current_x = it->hpos = 0;
+ it->current_x = line_start_x;
+ line_start_x = 0;
+ it->hpos = 0;
it->current_y += it->max_ascent + it->max_descent;
++it->vpos;
last_height = it->max_ascent + it->max_descent;
value of nlines is > 0 if continuation lines were involved. */
if (nlines > 0)
move_it_by_lines (it, nlines, 1);
-#if 0
- /* I think this assert is bogus if buffer contains
- invisible text or images. KFS. */
- xassert (IT_CHARPOS (*it) <= start_pos);
-#endif
}
else
{
}
while (target_y >= line_bottom_y (it) && IT_CHARPOS (*it) < ZV);
}
-
-#if 0
- /* I think this assert is bogus if buffer contains
- invisible text or images. KFS. */
- xassert (IT_CHARPOS (*it) >= BEGV);
-#endif
}
}
}
}
}
-
/* Notice any pending interrupt request to change frame size. */
do_pending_window_change (1);
return 1;
}
return 0;
-
-#if 0
- /* This code used to try to scroll the window just enough to make
- the line visible. It returned 0 to say that the caller should
- allocate larger glyph matrices. */
-
- if (MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row))
- {
- int dy = row->height - row->visible_height;
- w->vscroll = 0;
- w->cursor.y += dy;
- shift_glyph_matrix (w, matrix, 0, matrix->nrows, dy);
- }
- else /* MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row)) */
- {
- int dy = - (row->height - row->visible_height);
- w->vscroll = dy;
- w->cursor.y += dy;
- shift_glyph_matrix (w, matrix, 0, matrix->nrows, dy);
- }
-
- /* When we change the cursor y-position of the selected window,
- change this_line_y as well so that the display optimization for
- the cursor line of the selected window in redisplay_internal uses
- the correct y-position. */
- if (w == XWINDOW (selected_window))
- this_line_y = w->cursor.y;
-
- /* If vscrolling requires a larger glyph matrix, arrange for a fresh
- redisplay with larger matrices. */
- if (matrix->nrows < required_matrix_height (w))
- {
- fonts_changed_p = 1;
- return 0;
- }
-
- return 1;
-#endif /* 0 */
}
used_current_matrix_p = 1;
goto done;
-#if 0 /* try_cursor_movement never returns this value. */
- case CURSOR_MOVEMENT_NEED_LARGER_MATRICES:
- goto need_larger_matrices;
-#endif
-
case CURSOR_MOVEMENT_MUST_SCROLL:
goto try_to_scroll;
else
abort ();
-#if 0 /* This leads to problems, for instance when the cursor is
- at ZV, and the cursor line displays no text. */
- /* Disable rows below what's displayed in the window. This makes
- debugging easier. */
- enable_glyph_matrix_rows (current_matrix,
- XFASTINT (w->window_end_vpos) + 1,
- bottom_vpos, 0);
-#endif
-
IF_DEBUG (debug_end_pos = XFASTINT (w->window_end_pos);
debug_end_vpos = XFASTINT (w->window_end_vpos));
if (it->descent < 0)
it->descent = 0;
-#if 0 /* this breaks image tiling */
- /* If this glyph is alone on the last line, adjust it.ascent to minimum row ascent. */
- int face_ascent = face->font ? FONT_BASE (face->font) : FRAME_BASELINE_OFFSET (it->f);
- if (face_ascent > it->ascent)
- it->ascent = it->phys_ascent = face_ascent;
-#endif
-
it->nglyphs = 1;
if (face->box != FACE_NO_BOX)
{
if (SINGLE_BYTE_CHAR_P (it->c)
&& unibyte_display_via_language_environment)
- it->char_to_display = unibyte_char_to_multibyte (it->c);
- if (! SINGLE_BYTE_CHAR_P (it->char_to_display))
{
+ struct charset *unibyte = CHARSET_FROM_ID (charset_unibyte);
+
+ /* get_next_display_element assures that this decoding
+ never fails. */
+ it->char_to_display = DECODE_CHAR (unibyte, it->c);
it->multibyte_p = 1;
it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display,
-1, Qnil);
/* Skip truncation glyphs at the start of the glyph row. */
if (row->displays_text_p)
- for (; glyph < end && INTEGERP (glyph->object); ++glyph)
+ for (; glyph < end
+ && INTEGERP (glyph->object)
+ && glyph->charpos < 0;
+ ++glyph)
x += glyph->pixel_width;
/* Scan the glyph row, stopping before BEFORE_STRING or
/* Skip truncation glyphs at the start of the row. */
if (row->displays_text_p)
- for (; glyph < end && INTEGERP (glyph->object); ++glyph)
+ for (; glyph < end
+ && INTEGERP (glyph->object)
+ && glyph->charpos < 0;
+ ++glyph)
x += glyph->pixel_width;
/* Scan the glyph row, stopping at END_CHARPOS or when we encounter