summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog5
-rw-r--r--src/font.c10
2 files changed, 12 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4d539a30861..bfd3e833d16 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -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
diff --git a/src/font.c b/src/font.c
index 061b6086ac2..a72e2215956 100644
--- a/src/font.c
+++ b/src/font.c
@@ -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;
}