=== modified file 'src/font.c' --- src/font.c 2014-04-05 19:30:36 +0000 +++ src/font.c 2014-05-18 16:11:09 +0000 @@ -2803,10 +2803,16 @@ ASET (work, FONT_TYPE_INDEX, driver_list->driver->type); entity = assoc_no_quit (work, XCDR (cache)); if (CONSP (entity)) - entity = XCDR (entity); + { + entity = XCDR (entity); + fprintf (stderr, "%s: cached entity ", __func__); + debug_print (entity); + } else { entity = driver_list->driver->match (f, work); + fprintf (stderr, "%s: matched entity ", __func__); + debug_print (entity); if (!NILP (entity)) { Lisp_Object copy = copy_font_spec (work); @@ -3299,6 +3305,7 @@ Lisp_Object entity, name; entity = font_find_for_lface (f, attrs, spec, -1); + eassert (NILP (entity) || FONT_ENTITY_P (entity)); if (NILP (entity)) { /* No font is listed for SPEC, but each font-backend may have @@ -3307,6 +3314,7 @@ if (NILP (entity)) return Qnil; } + eassert (NILP (entity) || FONT_ENTITY_P (entity)); /* Don't lose the original name that was put in initially. We need it to re-apply the font when font parameters (like hinting or dpi) have changed. */