diff options
| -rw-r--r-- | src/ChangeLog | 2 | ||||
| -rw-r--r-- | src/xdisp.c | 40 |
2 files changed, 42 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1a83531ad10..77c37864b00 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -6,6 +6,8 @@ | |||
| 6 | visible character of the display line. This avoids funky | 6 | visible character of the display line. This avoids funky |
| 7 | horizontal shifting because the window start is not kept on the | 7 | horizontal shifting because the window start is not kept on the |
| 8 | same position. (Bug#15090) | 8 | same position. (Bug#15090) |
| 9 | (next_element_from_display_vector): Support 'box' face attribute | ||
| 10 | in the face definitions of a display vector. (Bug#15099) | ||
| 9 | 11 | ||
| 10 | 2013-08-15 Lars Magne Ingebrigtsen <larsi@gnus.org> | 12 | 2013-08-15 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 11 | 13 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index 4e1ddb36baa..bfa012ef70c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -7504,6 +7504,8 @@ static int | |||
| 7504 | next_element_from_display_vector (struct it *it) | 7504 | next_element_from_display_vector (struct it *it) |
| 7505 | { | 7505 | { |
| 7506 | Lisp_Object gc; | 7506 | Lisp_Object gc; |
| 7507 | int prev_face_id = it->face_id; | ||
| 7508 | int next_face_id; | ||
| 7507 | 7509 | ||
| 7508 | /* Precondition. */ | 7510 | /* Precondition. */ |
| 7509 | eassert (it->dpvec && it->current.dpvec_index >= 0); | 7511 | eassert (it->dpvec && it->current.dpvec_index >= 0); |
| @@ -7516,6 +7518,8 @@ next_element_from_display_vector (struct it *it) | |||
| 7516 | 7518 | ||
| 7517 | if (GLYPH_CODE_P (gc)) | 7519 | if (GLYPH_CODE_P (gc)) |
| 7518 | { | 7520 | { |
| 7521 | struct face *this_face, *prev_face, *next_face; | ||
| 7522 | |||
| 7519 | it->c = GLYPH_CODE_CHAR (gc); | 7523 | it->c = GLYPH_CODE_CHAR (gc); |
| 7520 | it->len = CHAR_BYTES (it->c); | 7524 | it->len = CHAR_BYTES (it->c); |
| 7521 | 7525 | ||
| @@ -7531,6 +7535,42 @@ next_element_from_display_vector (struct it *it) | |||
| 7531 | it->face_id = merge_faces (it->f, Qt, lface_id, | 7535 | it->face_id = merge_faces (it->f, Qt, lface_id, |
| 7532 | it->saved_face_id); | 7536 | it->saved_face_id); |
| 7533 | } | 7537 | } |
| 7538 | |||
| 7539 | /* Glyphs in the display vector could have the box face, so we | ||
| 7540 | need to set the related flags in the iterator, as | ||
| 7541 | appropriate. */ | ||
| 7542 | this_face = FACE_FROM_ID (it->f, it->face_id); | ||
| 7543 | prev_face = FACE_FROM_ID (it->f, prev_face_id); | ||
| 7544 | |||
| 7545 | /* Is this character the first character of a box-face run? */ | ||
| 7546 | it->start_of_box_run_p = (this_face && this_face->box != FACE_NO_BOX | ||
| 7547 | && (!prev_face | ||
| 7548 | || prev_face->box == FACE_NO_BOX)); | ||
| 7549 | |||
| 7550 | /* For the last character of the box-face run, we need to look | ||
| 7551 | either at the next glyph from the display vector, or at the | ||
| 7552 | face we saw before the display vector. */ | ||
| 7553 | if (it->current.dpvec_index < it->dpend - it->dpvec - 1) | ||
| 7554 | { | ||
| 7555 | if (it->dpvec_face_id >= 0) | ||
| 7556 | next_face_id = it->dpvec_face_id; | ||
| 7557 | else | ||
| 7558 | { | ||
| 7559 | int lface_id = | ||
| 7560 | GLYPH_CODE_FACE (it->dpvec[it->current.dpvec_index + 1]); | ||
| 7561 | |||
| 7562 | if (lface_id > 0) | ||
| 7563 | next_face_id = merge_faces (it->f, Qt, lface_id, | ||
| 7564 | it->saved_face_id); | ||
| 7565 | } | ||
| 7566 | } | ||
| 7567 | else | ||
| 7568 | next_face_id = it->saved_face_id; | ||
| 7569 | next_face = FACE_FROM_ID (it->f, next_face_id); | ||
| 7570 | it->end_of_box_run_p = (this_face && this_face->box != FACE_NO_BOX | ||
| 7571 | && (!next_face | ||
| 7572 | || next_face->box == FACE_NO_BOX)); | ||
| 7573 | it->face_box_p = this_face && this_face->box != FACE_NO_BOX; | ||
| 7534 | } | 7574 | } |
| 7535 | else | 7575 | else |
| 7536 | /* Display table entry is invalid. Return a space. */ | 7576 | /* Display table entry is invalid. Return a space. */ |