]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug #18162 with assertion violations due to empty face cache.
authorEli Zaretskii <eliz@gnu.org>
Thu, 7 Aug 2014 15:18:10 +0000 (18:18 +0300)
committerEli Zaretskii <eliz@gnu.org>
Thu, 7 Aug 2014 15:18:10 +0000 (18:18 +0300)
 src/fontset.c (Finternal_char_font): Recompute basic faces if the
 frame's face cache was cleared.

src/ChangeLog
src/fontset.c

index de56e3501d8c6c2861908fb841b5a82ae4222cae..a3ebe781be5ca54b536b18c403961b5794ab19d0 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-07  Eli Zaretskii  <eliz@gnu.org>
+
+       * fontset.c (Finternal_char_font): Recompute basic faces if the
+       frame's face cache was cleared.  (Bug#18162)
+
 2014-08-05  Dmitry Antipov  <dmantipov@yandex.ru>
 
        Fix bug with uninitialized undo list of an indirect buffer (Bug#18180).
index 13f5357be6463e19a53b3af8af985aeef024232d..08413ae15719970cbab7a3fdb6297b339163bce0 100644 (file)
@@ -1860,6 +1860,10 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
     return Qnil;
   if (!FRAME_WINDOW_P (f))
     return Qnil;
+  /* We need the basic faces to be valid below, so recompute them if
+     some code just happened to clear the face cache.  */
+  if (FRAME_FACE_CACHE (f)->used == 0)
+    recompute_basic_faces (f);
   face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c, pos, Qnil);
   face = FACE_FROM_ID (f, face_id);
   if (face->font)