[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/xfaces.c,v
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] Changes to emacs/src/xfaces.c,v |
Date: |
Mon, 30 Jun 2008 02:09:21 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Chong Yidong <cyd> 08/06/30 02:09:21
Index: xfaces.c
===================================================================
RCS file: /sources/emacs/emacs/src/xfaces.c,v
retrieving revision 1.400
retrieving revision 1.401
diff -u -b -r1.400 -r1.401
--- xfaces.c 25 Jun 2008 07:35:33 -0000 1.400
+++ xfaces.c 30 Jun 2008 02:09:21 -0000 1.401
@@ -3942,10 +3942,11 @@
{
int i;
Lisp_Object global_lface, local_lface, *gvec, *lvec;
+ struct frame *f = XFRAME (frame);
CHECK_LIVE_FRAME (frame);
global_lface = lface_from_face_name (NULL, face, 1);
- local_lface = lface_from_face_name (XFRAME (frame), face, 0);
+ local_lface = lface_from_face_name (f, face, 0);
if (NILP (local_lface))
local_lface = Finternal_make_lisp_face (face, frame);
@@ -3957,12 +3958,36 @@
lvec = XVECTOR (local_lface)->contents;
gvec = XVECTOR (global_lface)->contents;
for (i = 1; i < LFACE_VECTOR_SIZE; ++i)
- if (! UNSPECIFIEDP (gvec[i]))
- {
if (IGNORE_DEFFACE_P (gvec[i]))
lvec[i] = Qunspecified;
- else
+ else if (! UNSPECIFIEDP (gvec[i]))
lvec[i] = gvec[i];
+
+ /* If the default face was changed, realize it again, and update the
+ `font' face parameter. */
+ if (EQ (face, Qdefault))
+ {
+ struct face_cache *c = FRAME_FACE_CACHE (f);
+ 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)
+ {
+ Lisp_Object name = newface->font->props[FONT_NAME_INDEX];
+ Fmodify_frame_parameters (frame, Fcons (Fcons (Qfont, name),
+ Qnil));
+ }
}
return Qnil;
- [Emacs-diffs] Changes to emacs/src/xfaces.c,v, Miles Bader, 2008/06/01
- [Emacs-diffs] Changes to emacs/src/xfaces.c,v, Kenichi Handa, 2008/06/01
- [Emacs-diffs] Changes to emacs/src/xfaces.c,v, Kenichi Handa, 2008/06/05
- [Emacs-diffs] Changes to emacs/src/xfaces.c,v, Kenichi Handa, 2008/06/05
- [Emacs-diffs] Changes to emacs/src/xfaces.c,v, Kenichi Handa, 2008/06/12
- [Emacs-diffs] Changes to emacs/src/xfaces.c,v, Juanma Barranquero, 2008/06/16
- [Emacs-diffs] Changes to emacs/src/xfaces.c,v, Kenichi Handa, 2008/06/17
- [Emacs-diffs] Changes to emacs/src/xfaces.c,v, Kenichi Handa, 2008/06/25
- [Emacs-diffs] Changes to emacs/src/xfaces.c,v,
Chong Yidong <=
- [Emacs-diffs] Changes to emacs/src/xfaces.c,v, Chong Yidong, 2008/06/29