From: Chong Yidong Date: Thu, 5 Oct 2006 17:33:41 +0000 (+0000) Subject: * frame.c (Qinhibit_face_set_after_frame_default): New var. X-Git-Tag: emacs-pretest-22.0.90~228 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=26c34ec2e7555f88ce38a942e0b5f61e7a118552;p=emacs.git * 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. --- diff --git a/src/ChangeLog b/src/ChangeLog index f64020ca34d..ba72e990112 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2006-10-05 Chong Yidong + + * 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 * lisp.h (clear_regexp_cache): Declare. diff --git a/src/frame.c b/src/frame.c index 82a016be69e..0b835ffd3b9 100644 --- a/src/frame.c +++ b/src/frame.c @@ -109,6 +109,7 @@ Lisp_Object Qtty_color_mode; 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 @@ x_set_frame_parameters (f, alist) || 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 @@ x_set_frame_parameters (f, alist) < 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 @@ syms_of_frame () 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");