changeset 51092:c559952fe972

(Finternal_set_lisp_face_attribute): Handle Qunspecified as value for QCfont attribute. (realize_default_face): lface should already exist; crash if not. Specify 0 for FORCE_P when calling set_lface_from_font_name.
author Richard M. Stallman <rms@gnu.org>
date Mon, 19 May 2003 14:41:09 +0000
parents 178720d9eaff
children 2c04067bcdc0
files src/xfaces.c
diffstat 1 files changed, 17 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfaces.c	Mon May 19 14:38:44 2003 +0000
+++ b/src/xfaces.c	Mon May 19 14:41:09 2003 +0000
@@ -4156,20 +4156,24 @@
 	  struct frame *f;
 	  Lisp_Object tmp;
 
-	  CHECK_STRING (value);
 	  if (EQ (frame, Qt))
 	    f = SELECTED_FRAME ();
 	  else
 	    f = check_x_frame (frame);
 
-	  /* VALUE may be a fontset name or an alias of fontset.  In
-	     such a case, use the base fontset name.  */
-	  tmp = Fquery_fontset (value, Qnil);
-	  if (!NILP (tmp))
-	    value = tmp;
-
-	  if (!set_lface_from_font_name (f, lface, value, 1, 1))
-	    signal_error ("Invalid font or fontset name", value);
+	  if (!UNSPECIFIEDP (value))
+	    {
+	      CHECK_STRING (value);
+
+	      /* VALUE may be a fontset name or an alias of fontset.  In
+		 such a case, use the base fontset name.  */
+	      tmp = Fquery_fontset (value, Qnil);
+	      if (!NILP (tmp))
+		value = tmp;
+
+	      if (!set_lface_from_font_name (f, lface, value, 1, 1))
+		signal_error ("Invalid font or fontset name", value);
+	    }
 
 	  font_attr_p = 1;
 	}
@@ -6590,11 +6594,7 @@
   /* If the `default' face is not yet known, create it.  */
   lface = lface_from_face_name (f, Qdefault, 0);
   if (NILP (lface))
-    {
-      Lisp_Object frame;
-      XSETFRAME (frame, f);
-      lface = Finternal_make_lisp_face (Qdefault, frame);
-    }
+    abort ();
 
 #ifdef HAVE_WINDOW_SYSTEM
   if (FRAME_WINDOW_P (f))
@@ -6603,7 +6603,9 @@
       frame_font = Fassq (Qfont, f->param_alist);
       xassert (CONSP (frame_font) && STRINGP (XCDR (frame_font)));
       frame_font = XCDR (frame_font);
-      set_lface_from_font_name (f, lface, frame_font, 1, 1);
+      /* Specify 0 for FORCE_P here, so that we don't override
+	 a :family attribute specified for `default' for new frames.  */
+      set_lface_from_font_name (f, lface, frame_font, 0, 1);
     }
 #endif /* HAVE_WINDOW_SYSTEM */