Subject: Re: bug#17486: 24.4.50; set-face-font problem on OSX

From: Dmitry Antipov <[email-masked]>
Date: Mon, 19 May 2014 07:38:51 +0400

On 05/18/2014 10:33 PM, Jan Djärv wrote:

>> Hm... so font_matching_entity sometimes returns [#<font-entity>] instead of #<font-entity>.
>> Something may be wrong with font cache or with font driver-specific match routine.
>
> How can code (driver-specific) that has not changed suddenly become wrong?

It may return something which doesn't match font cache data structures any more
because the latter was changed (mostly to avoid glitches in compact_font_caches).

There was a slight confusion between font_list_entities (which operates
on vectors of font entities) and font_matching_entity (which should operate
on font entities). Hopefully the fix is almost obvious.

Dmitry

=== modified file 'src/font.c'
--- src/font.c	2014-04-05 19:30:36 +0000
+++ src/font.c	2014-05-19 03:23:51 +0000
@@ -2803,7 +2803,7 @@
 	ASET (work, FONT_TYPE_INDEX, driver_list->driver->type);
 	entity = assoc_no_quit (work, XCDR (cache));
 	if (CONSP (entity))
-	  entity = XCDR (entity);
+	  entity = AREF (XCDR (entity), 0);
 	else
 	  {
 	    entity = driver_list->driver->match (f, work);