]> git.eshelyaron.com Git - emacs.git/commitdiff
(font_load_for_lface, font_open_by_name): Don't store name
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Tue, 1 Dec 2009 09:07:36 +0000 (09:07 +0000)
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Tue, 1 Dec 2009 09:07:36 +0000 (09:07 +0000)
if entity is Qnil.

src/ChangeLog
src/font.c

index 4d539a308610caa02d2b18efb93c1df2191e815f..bfd3e833d1685a54c99af10410ebb6df93ca9c0a 100644 (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
index 061b6086ac278a9ef7b7df838ad55d68516962b6..a72e2215956994db89df691c691aa8108aa1305d 100644 (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;
 }