merge from trunk

This commit is contained in:
Joakim Verona 2013-08-15 17:32:29 +02:00
commit a2125dbbe3
2 changed files with 42 additions and 0 deletions

View file

@ -6,6 +6,8 @@
visible character of the display line. This avoids funky
horizontal shifting because the window start is not kept on the
same position. (Bug#15090)
(next_element_from_display_vector): Support 'box' face attribute
in the face definitions of a display vector. (Bug#15099)
2013-08-15 Lars Magne Ingebrigtsen <larsi@gnus.org>

View file

@ -7504,6 +7504,8 @@ static int
next_element_from_display_vector (struct it *it)
{
Lisp_Object gc;
int prev_face_id = it->face_id;
int next_face_id;
/* Precondition. */
eassert (it->dpvec && it->current.dpvec_index >= 0);
@ -7516,6 +7518,8 @@ next_element_from_display_vector (struct it *it)
if (GLYPH_CODE_P (gc))
{
struct face *this_face, *prev_face, *next_face;
it->c = GLYPH_CODE_CHAR (gc);
it->len = CHAR_BYTES (it->c);
@ -7531,6 +7535,42 @@ next_element_from_display_vector (struct it *it)
it->face_id = merge_faces (it->f, Qt, lface_id,
it->saved_face_id);
}
/* Glyphs in the display vector could have the box face, so we
need to set the related flags in the iterator, as
appropriate. */
this_face = FACE_FROM_ID (it->f, it->face_id);
prev_face = FACE_FROM_ID (it->f, prev_face_id);
/* Is this character the first character of a box-face run? */
it->start_of_box_run_p = (this_face && this_face->box != FACE_NO_BOX
&& (!prev_face
|| prev_face->box == FACE_NO_BOX));
/* For the last character of the box-face run, we need to look
either at the next glyph from the display vector, or at the
face we saw before the display vector. */
if (it->current.dpvec_index < it->dpend - it->dpvec - 1)
{
if (it->dpvec_face_id >= 0)
next_face_id = it->dpvec_face_id;
else
{
int lface_id =
GLYPH_CODE_FACE (it->dpvec[it->current.dpvec_index + 1]);
if (lface_id > 0)
next_face_id = merge_faces (it->f, Qt, lface_id,
it->saved_face_id);
}
}
else
next_face_id = it->saved_face_id;
next_face = FACE_FROM_ID (it->f, next_face_id);
it->end_of_box_run_p = (this_face && this_face->box != FACE_NO_BOX
&& (!next_face
|| next_face->box == FACE_NO_BOX));
it->face_box_p = this_face && this_face->box != FACE_NO_BOX;
}
else
/* Display table entry is invalid. Return a space. */