static struct glyph_row *get_overlay_arrow_glyph_row P_ ((struct window *,
Lisp_Object));
static void extend_face_to_end_of_line P_ ((struct it *));
-static int append_space P_ ((struct it *, int));
+static int append_space_for_newline P_ ((struct it *));
static int make_cursor_line_fully_visible P_ ((struct window *, int));
static int try_scrolling P_ ((Lisp_Object, int, EMACS_INT, EMACS_INT, int, int));
static int try_cursor_movement P_ ((Lisp_Object, struct text_pos, int *));
/* Append one space to the glyph row of iterator IT if doing a
- window-based redisplay. DEFAULT_FACE_P non-zero means let the
- space have the default face, otherwise let it have the same face as
+ window-based redisplay. The space has the same face as
IT->face_id. Value is non-zero if a space was added.
This function is called to make sure that there is always one glyph
end of the line if the row ends in italic text. */
static int
-append_space (it, default_face_p)
+append_space_for_newline (it)
struct it *it;
- int default_face_p;
{
if (FRAME_WINDOW_P (it->f))
{
/* Save some values that must not be changed.
Must save IT->c and IT->len because otherwise
ITERATOR_AT_END_P wouldn't work anymore after
- append_space has been called. */
+ append_space_for_newline has been called. */
enum display_element_type saved_what = it->what;
int saved_c = it->c, saved_len = it->len;
int saved_x = it->current_x;
it->c = ' ';
it->len = 1;
- if (default_face_p)
- it->face_id = DEFAULT_FACE_ID;
- else if (it->face_before_selective_p)
+ if (it->face_before_selective_p)
it->face_id = it->saved_face_id;
face = FACE_FROM_ID (it->f, it->face_id);
it->face_id = FACE_FOR_CHAR (it->f, face, 0);
row->exact_window_width_line_p = 1;
else
#endif /* HAVE_WINDOW_SYSTEM */
- if ((append_space (it, 1) && row->used[TEXT_AREA] == 1)
+ if ((append_space_for_newline (it) && row->used[TEXT_AREA] == 1)
|| row->used[TEXT_AREA] == 0)
{
row->glyphs[TEXT_AREA]->charpos = -1;
/* Add a space at the end of the line that is used to
display the cursor there. */
if (!IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))
- append_space (it, 0);
+ append_space_for_newline (it);
#endif /* HAVE_WINDOW_SYSTEM */
/* Extend the face to the end of the line. */
x_produce_glyphs (it)
struct it *it;
{
+ int extra_line_spacing = it->extra_line_spacing;
+
it->glyph_not_available_p = 0;
if (it->what == IT_CHARACTER)
}
it->phys_ascent = min (it->phys_ascent, it->ascent);
it->phys_descent = min (it->phys_descent, it->descent);
+ extra_line_spacing = 0;
}
/* If this is a space inside a region of text with
But if previous part of the line set a height, don't
increase that height */
+ Lisp_Object lsp;
+
it->pixel_width = 0;
it->nglyphs = 0;
+ lsp = Fget_text_property (IT_CHARPOS (*it), Qline_spacing, it->w->buffer);
+
it->ascent = FONT_BASE (font) + boff;
it->descent = FONT_DESCENT (font) - boff;
- if (it->max_ascent > 0 || it->max_descent > 0)
+ if (EQ (lsp, Qt))
{
- it->ascent = it->descent = 0;
+ if (it->descent > it->max_descent)
+ {
+ it->ascent += it->descent - it->max_descent;
+ it->descent = it->max_descent;
+ }
+ if (it->ascent> it->max_ascent)
+ {
+ it->descent = min (it->max_descent, it->descent + it->ascent - it->max_ascent);
+ it->ascent = it->max_ascent;
+ }
+ it->phys_ascent = min (it->phys_ascent, it->ascent);
+ it->phys_descent = min (it->phys_descent, it->descent);
+ extra_line_spacing = 0;
}
else
{
- it->ascent = FONT_BASE (font) + boff;
- it->descent = FONT_DESCENT (font) - boff;
- }
-
- it->phys_ascent = it->ascent;
- it->phys_descent = it->descent;
+ it->phys_ascent = it->ascent;
+ it->phys_descent = it->descent;
- if ((it->max_ascent > 0 || it->max_descent > 0)
- && face->box != FACE_NO_BOX
- && face->box_line_width > 0)
- {
- it->ascent += face->box_line_width;
- it->descent += face->box_line_width;
+ if ((it->max_ascent > 0 || it->max_descent > 0)
+ && face->box != FACE_NO_BOX
+ && face->box_line_width > 0)
+ {
+ it->ascent += face->box_line_width;
+ it->descent += face->box_line_width;
+ }
+ if (INTEGERP (lsp))
+ extra_line_spacing = XINT (lsp);
+ else if (FLOATP (lsp))
+ extra_line_spacing = (it->phys_ascent + it->phys_descent) * XFLOAT_DATA (lsp);
}
}
else if (it->char_to_display == '\t')
if (it->area == TEXT_AREA)
it->current_x += it->pixel_width;
- it->descent += it->extra_line_spacing;
+ it->descent += extra_line_spacing;
it->max_ascent = max (it->max_ascent, it->ascent);
it->max_descent = max (it->max_descent, it->descent);