/* Display generation from window structure and buffer text.
Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995,
1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005 Free Software Foundation, Inc.
+ 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Emacs.
struct it *it;
{
enum prop_handled handled;
- int handle_overlay_change_p = 1;
+ int handle_overlay_change_p;
struct props *p;
it->dpvec = NULL;
it->current.dpvec_index = -1;
+ handle_overlay_change_p = !it->ignore_overlay_strings_at_pos_p;
+ it->ignore_overlay_strings_at_pos_p = 0;
/* Use face of preceding text for ellipsis (if invisible) */
if (it->selective_display_ellipsis_p)
skip starting with next_stop. */
if (invis_p)
IT_CHARPOS (*it) = next_stop;
+
+ /* If there are adjacent invisible texts, don't lose the
+ second one's ellipsis. */
+ if (invis_p == 2)
+ display_ellipsis_p = 1;
}
while (invis_p);
it->stack[it->sp - 1].display_ellipsis_p = display_ellipsis_p;
}
else if (display_ellipsis_p)
- setup_for_ellipsis (it, 0);
+ {
+ /* Make sure that the glyphs of the ellipsis will get
+ correct `charpos' values. If we would not update
+ it->position here, the glyphs would belong to the
+ last visible character _before_ the invisible
+ text, which confuses `set_cursor_from_row'.
+
+ We use the last invisible position instead of the
+ first because this way the cursor is always drawn on
+ the first "." of the ellipsis, whenever PT is inside
+ the invisible text. Otherwise the cursor would be
+ placed _after_ the ellipsis when the point is after the
+ first invisible character. */
+ it->position.charpos = IT_CHARPOS (*it) - 1;
+ it->position.bytepos = CHAR_TO_BYTE (it->position.charpos);
+ setup_for_ellipsis (it, 0);
+ }
}
}
{
it->method = GET_FROM_STRETCH;
it->object = value;
- it->current.pos = it->position = start_pos;
+ *position = it->position = start_pos;
}
#ifdef HAVE_WINDOW_SYSTEM
else
reseat_at_next_visible_line_start (it, 1);
else if (it->dpvec_char_len > 0)
{
+ if (it->method == GET_FROM_STRING
+ && it->n_overlay_strings > 0)
+ it->ignore_overlay_strings_at_pos_p = 1;
it->len = it->dpvec_char_len;
set_iterator_to_next (it, reseat_p);
}
produce_special_glyphs (it, IT_CONTINUATION);
row->continued_p = 1;
+ it->current_x = x_before;
it->continuation_lines_width += x;
+ extend_face_to_end_of_line (it);
if (nglyphs > 1 && i > 0)
{
while (CONSP (tail))
{
tem = XCAR (tail);
-
+
if (EQ (elt, tem))
{
/* Splice out the link TAIL. */
{
/* If the face of this glyph string has to be drawn to the end of
the drawing area, set S->extends_to_end_of_line_p. */
- struct face *default_face = FACE_FROM_ID (s->f, DEFAULT_FACE_ID);
if (start == s->row->used[s->area]
&& s->area == TEXT_AREA
- && ((s->hl == DRAW_NORMAL_TEXT
- && (s->row->fill_line_p
- || s->face->background != default_face->background
- || s->face->stipple != default_face->stipple
- || s->row->mouse_face_p))
- || s->hl == DRAW_MOUSE_FACE
- || ((s->hl == DRAW_IMAGE_RAISED || s->hl == DRAW_IMAGE_SUNKEN)
- && s->row->fill_line_p)))
- s->extends_to_end_of_line_p = 1;
+ && ((s->row->fill_line_p
+ && (s->hl == DRAW_NORMAL_TEXT
+ || s->hl == DRAW_IMAGE_RAISED
+ || s->hl == DRAW_IMAGE_SUNKEN))
+ || s->hl == DRAW_MOUSE_FACE))
+ s->extends_to_end_of_line_p = 1;
/* If S extends its face to the end of the line, set its
background_width to the distance to the right edge of the drawing
else
ascent = (height * FONT_BASE (font)) / FONT_HEIGHT (font);
+ if (width > 0 && !it->truncate_lines_p
+ && it->current_x + width > it->last_visible_x)
+ width = it->last_visible_x - it->current_x - 1;
+
if (width > 0 && height > 0 && it->glyph_row)
{
Lisp_Object object = it->stack[it->sp - 1].string;
/* RIF:
Produce glyphs/get display metrics for the display element IT is
- loaded with. See the description of struct display_iterator in
- dispextern.h for an overview of struct display_iterator. */
+ loaded with. See the description of struct it in dispextern.h
+ for an overview of struct it. */
void
x_produce_glyphs (it)
{
if (w == XWINDOW (echo_area_window))
{
- *width = FRAME_CURSOR_WIDTH (f);
- return FRAME_DESIRED_CURSOR (f);
+ if (EQ (b->cursor_type, Qt) || NILP (b->cursor_type))
+ {
+ *width = FRAME_CURSOR_WIDTH (f);
+ return FRAME_DESIRED_CURSOR (f);
+ }
+ else
+ return get_specified_cursor_type (b->cursor_type, width);
}
*active_cursor = 0;
/* Use cursor-in-non-selected-windows for non-selected window or frame. */
if (non_selected)
{
- alt_cursor = XBUFFER (w->buffer)->cursor_in_non_selected_windows;
+ alt_cursor = b->cursor_in_non_selected_windows;
return get_specified_cursor_type (alt_cursor, width);
}
if (row == last)
end_hpos = dpyinfo->mouse_face_end_col;
else
- end_hpos = row->used[TEXT_AREA];
+ {
+ end_hpos = row->used[TEXT_AREA];
+ if (draw == DRAW_NORMAL_TEXT)
+ row->fill_line_p = 1; /* Clear to end of line */
+ }
if (end_hpos > start_hpos)
{
Each element has the form (ON-STATE . OFF-STATE). Whenever the
`cursor-type' frame-parameter or variable equals ON-STATE,
comparing using `equal', Emacs uses OFF-STATE to specify
-how to blink it off. */);
+how to blink it off. ON-STATE and OFF-STATE are values for
+the `cursor-type' frame parameter.
+
+If a frame's ON-STATE has no entry in this list,
+the frame's other specifications determine how to blink the cursor off. */);
Vblink_cursor_alist = Qnil;
DEFVAR_BOOL ("auto-hscroll-mode", &automatic_hscrolling_p,