diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2008-07-05 21:16:05 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2008-07-05 21:16:05 +0000 |
commit | 0421a7a78070479cda40ad44cfd2f1ac6879c640 (patch) | |
tree | f12fa84bacec050c0a6ef459a922a16ff7949ca3 /src/xfaces.c | |
parent | 0a143d3a0fe2198b99418bda030cc46efbfd0e40 (diff) | |
download | emacs-0421a7a78070479cda40ad44cfd2f1ac6879c640.tar.gz |
(Finternal_merge_in_global_face): Don't realize default face if it
didn't already exist.
Diffstat (limited to 'src/xfaces.c')
-rw-r--r-- | src/xfaces.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index 8482608832a..382e1327679 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -3971,22 +3971,26 @@ Default face attributes override any local face attributes. */) struct face *newface, *oldface = FACE_FROM_ID (f, DEFAULT_FACE_ID); Lisp_Object attrs[LFACE_VECTOR_SIZE]; - bcopy (oldface->lface, attrs, sizeof attrs); - merge_face_vectors (f, lvec, attrs, 0); - newface = realize_face (c, attrs, DEFAULT_FACE_ID); - - if ((! UNSPECIFIEDP (gvec[LFACE_FAMILY_INDEX]) - || ! UNSPECIFIEDP (gvec[LFACE_FOUNDRY_INDEX]) - || ! UNSPECIFIEDP (gvec[LFACE_HEIGHT_INDEX]) - || ! UNSPECIFIEDP (gvec[LFACE_WEIGHT_INDEX]) - || ! UNSPECIFIEDP (gvec[LFACE_SLANT_INDEX]) - || ! UNSPECIFIEDP (gvec[LFACE_SWIDTH_INDEX]) - || ! UNSPECIFIEDP (gvec[LFACE_FONT_INDEX])) - && newface->font) + /* This can be NULL (e.g., in batch mode). */ + if (oldface) { - Lisp_Object name = newface->font->props[FONT_NAME_INDEX]; - Fmodify_frame_parameters (frame, Fcons (Fcons (Qfont, name), - Qnil)); + bcopy (oldface->lface, attrs, sizeof attrs); + merge_face_vectors (f, lvec, attrs, 0); + newface = realize_face (c, attrs, DEFAULT_FACE_ID); + + if ((! UNSPECIFIEDP (gvec[LFACE_FAMILY_INDEX]) + || ! UNSPECIFIEDP (gvec[LFACE_FOUNDRY_INDEX]) + || ! UNSPECIFIEDP (gvec[LFACE_HEIGHT_INDEX]) + || ! UNSPECIFIEDP (gvec[LFACE_WEIGHT_INDEX]) + || ! UNSPECIFIEDP (gvec[LFACE_SLANT_INDEX]) + || ! UNSPECIFIEDP (gvec[LFACE_SWIDTH_INDEX]) + || ! UNSPECIFIEDP (gvec[LFACE_FONT_INDEX])) + && newface->font) + { + Lisp_Object name = newface->font->props[FONT_NAME_INDEX]; + Fmodify_frame_parameters (frame, Fcons (Fcons (Qfont, name), + Qnil)); + } } } |