changeset 73253:108f4a391eaa

* frame.c (Qinhibit_face_set_after_frame_default): New var. (syms_of_frame): Initialize it. (x_set_frame_parameters): Avoid resetting :font attributes to the new-frame defaults.
author Chong Yidong <cyd@stupidchicken.com>
date Thu, 05 Oct 2006 17:33:41 +0000
parents de889a66a184
children 828010b87f61
files src/ChangeLog src/frame.c
diffstat 2 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Oct 05 16:23:42 2006 +0000
+++ b/src/ChangeLog	Thu Oct 05 17:33:41 2006 +0000
@@ -1,3 +1,10 @@
+2006-10-05  Chong Yidong  <cyd@stupidchicken.com>
+
+	* frame.c (Qinhibit_face_set_after_frame_default): New var.
+	(syms_of_frame): Initialize it.
+	(x_set_frame_parameters): Avoid resetting :font attributes to the
+	new-frame defaults.
+
 2006-10-03  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* lisp.h (clear_regexp_cache): Declare.
--- a/src/frame.c	Thu Oct 05 16:23:42 2006 +0000
+++ b/src/frame.c	Thu Oct 05 17:33:41 2006 +0000
@@ -109,6 +109,7 @@
 
 Lisp_Object Qfullscreen, Qfullwidth, Qfullheight, Qfullboth;
 
+Lisp_Object Qinhibit_face_set_after_frame_default;
 Lisp_Object Qface_set_after_frame_default;
 
 
@@ -2729,12 +2730,20 @@
           || EQ (prop, Qfullscreen))
 	{
 	  register Lisp_Object param_index, old_value;
+	  int count = SPECPDL_INDEX ();
 
 	  old_value = get_frame_param (f, prop);
  	  fullscreen_is_being_set |= EQ (prop, Qfullscreen);
 
 	  if (NILP (Fequal (val, old_value)))
 	    {
+	      /* For :font attributes, the frame_parm_handler
+		 x_set_font calls `face-set-after-frame-default'.
+		 Unless we bind inhibit-face-set-after-frame-default
+		 here, this would reset the :font attribute that we
+		 just applied to the default value for new faces.  */
+	      specbind (Qinhibit_face_set_after_frame_default, Qt);
+
 	      store_frame_param (f, prop, val);
 
 	      param_index = Fget (prop, Qx_frame_parameter);
@@ -2743,6 +2752,8 @@
 		      < sizeof (frame_parms)/sizeof (frame_parms[0]))
 		  && rif->frame_parm_handlers[XINT (param_index)])
 		(*(rif->frame_parm_handlers[XINT (param_index)])) (f, val, old_value);
+
+	      unbind_to (count, Qnil);
 	    }
 	}
     }
@@ -4004,6 +4015,10 @@
   Qface_set_after_frame_default = intern ("face-set-after-frame-default");
   staticpro (&Qface_set_after_frame_default);
 
+  Qinhibit_face_set_after_frame_default
+    = intern ("inhibit-face-set-after-frame-default");
+  staticpro (&Qinhibit_face_set_after_frame_default);
+
   Qfullwidth = intern ("fullwidth");
   staticpro (&Qfullwidth);
   Qfullheight = intern ("fullheight");