struct bidi_string_data *);
extern void produce_stretch_glyph (struct it *);
extern int merge_glyphless_glyph_face (struct it *);
+extern void forget_escape_and_glyphless_faces (void);
extern void get_font_ascent_descent (struct font *, int *, int *);
return face_id;
}
+/* Forget the `escape-glyph' and `glyphless-char' faces. This should
+ be called before redisplaying windows, and when the frame's face
+ cache is freed. */
+void
+forget_escape_and_glyphless_faces (void)
+{
+ last_escape_glyph_frame = NULL;
+ last_escape_glyph_face_id = (1 << FACE_ID_BITS);
+ last_glyphless_glyph_frame = NULL;
+ last_glyphless_glyph_face_id = (1 << FACE_ID_BITS);
+}
+
/* Load IT's display element fields with information about the next
display element from the current position of IT. Value is false if
end of buffer (or C string) is reached. */
Lisp_Object window;
struct text_pos start;
+ /* We are about to enter redisplay without going through
+ redisplay_internal, so we need to forget these faces by hand
+ here. */
+ forget_escape_and_glyphless_faces ();
+
/* Do this before displaying, so that we have a large enough glyph
matrix for the display. If we can't get enough space for the
whole text, display the last N lines. That works by setting w->start. */
sw = w;
pending = false;
- last_escape_glyph_frame = NULL;
- last_escape_glyph_face_id = (1 << FACE_ID_BITS);
- last_glyphless_glyph_frame = NULL;
- last_glyphless_glyph_face_id = (1 << FACE_ID_BITS);
+ forget_escape_and_glyphless_faces ();
/* If face_change, init_iterator will free all realized faces, which
includes the faces referenced from current matrices. So, we
c->faces_by_id[i] = NULL;
}
+ /* Forget the escape-glyph and glyphless-char faces. */
+ forget_escape_and_glyphless_faces ();
c->used = 0;
size = FACE_CACHE_BUCKETS_SIZE * sizeof *c->buckets;
memset (c->buckets, 0, size);