(font_load_for_lface, font_open_by_name): Don't store name

if entity is Qnil.
This commit is contained in:
YAMAMOTO Mitsuharu 2009-12-01 09:07:36 +00:00
parent c31a2fdc34
commit 8096a0ff8c
2 changed files with 12 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2009-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* font.c (font_load_for_lface, font_open_by_name): Don't store name
if entity is Qnil.
2009-11-30 Stefan Monnier <monnier@iro.umontreal.ca>
* print.c (print_preprocess): Preprocess the key_and_value table of

View file

@ -3537,8 +3537,11 @@ font_load_for_lface (f, attrs, spec)
it to re-apply the font when font parameters (like hinting or dpi) have
changed. */
entity = font_open_for_lface (f, entity, attrs, spec);
name = Ffont_get (spec, QCname);
if (STRINGP (name)) font_put_extra (entity, QCname, name);
if (!NILP (entity))
{
name = Ffont_get (spec, QCname);
if (STRINGP (name)) font_put_extra (entity, QCname, name);
}
return entity;
}
@ -3610,7 +3613,8 @@ font_open_by_name (f, name)
spec = Ffont_spec (2, args);
ret = font_open_by_spec (f, spec);
/* Do not loose name originally put in. */
font_put_extra (ret, QCname, args[1]);
if (!NILP (ret))
font_put_extra (ret, QCname, args[1]);
return ret;
}