diff options
| author | Eli Zaretskii | 2017-11-30 19:55:41 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2017-11-30 19:55:41 +0200 |
| commit | bdbcdbac431d672915c92fc77dbf7326f338cecb (patch) | |
| tree | 9893c109d8dbdc0aed12b1cdd4fc27873000a77f /src | |
| parent | 408862f02a874dcd9cfc2599adb35dec522b3ef4 (diff) | |
| download | emacs-bdbcdbac431d672915c92fc77dbf7326f338cecb.tar.gz emacs-bdbcdbac431d672915c92fc77dbf7326f338cecb.zip | |
Avoid assertions in find-composition
* src/font.c (font_range): If called with STRING non-nil and FACE
a NULL pointer, compute face by calling face_at_string_position.
(Bug#29506)
* lisp/composite.el (find-composition): Doc fix.
Diffstat (limited to 'src')
| -rw-r--r-- | src/font.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/font.c b/src/font.c index f7cebdce78c..441652b0951 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -3794,19 +3794,26 @@ font_range (ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t *limit, | |||
| 3794 | int c; | 3794 | int c; |
| 3795 | Lisp_Object font_object = Qnil; | 3795 | Lisp_Object font_object = Qnil; |
| 3796 | 3796 | ||
| 3797 | if (NILP (string)) | 3797 | if (!face) |
| 3798 | { | 3798 | { |
| 3799 | if (! face) | 3799 | struct frame *f = XFRAME (w->frame); |
| 3800 | int face_id; | ||
| 3801 | |||
| 3802 | if (NILP (string)) | ||
| 3803 | face_id = face_at_buffer_position (w, pos, &ignore, *limit, | ||
| 3804 | false, -1); | ||
| 3805 | else | ||
| 3800 | { | 3806 | { |
| 3801 | int face_id; | 3807 | face_id = |
| 3808 | NILP (Vface_remapping_alist) | ||
| 3809 | ? DEFAULT_FACE_ID | ||
| 3810 | : lookup_basic_face (f, DEFAULT_FACE_ID); | ||
| 3802 | 3811 | ||
| 3803 | face_id = face_at_buffer_position (w, pos, &ignore, | 3812 | face_id = face_at_string_position (w, string, pos, 0, &ignore, |
| 3804 | *limit, false, -1); | 3813 | face_id, false); |
| 3805 | face = FACE_FROM_ID (XFRAME (w->frame), face_id); | ||
| 3806 | } | 3814 | } |
| 3815 | face = FACE_FROM_ID (f, face_id); | ||
| 3807 | } | 3816 | } |
| 3808 | else | ||
| 3809 | eassert (face); | ||
| 3810 | 3817 | ||
| 3811 | while (pos < *limit) | 3818 | while (pos < *limit) |
| 3812 | { | 3819 | { |