changeset 67056:3ce17ff4a61f

(merge_face_vectors): Don't do :ignore-defface overwriting here. (Finternal_merge_in_global_face): Do it here.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 20 Nov 2005 22:35:48 +0000
parents c6ae377fa1f0
children 10e217ceeee2
files src/ChangeLog src/xfaces.c
diffstat 2 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sun Nov 20 19:21:20 2005 +0000
+++ b/src/ChangeLog	Sun Nov 20 22:35:48 2005 +0000
@@ -4,6 +4,8 @@
 	:ignore-defface for new frame defaults when `unspecified' is
 	supplied.
 	(Finternal_get_lisp_face_attribute): Hide :ignore-defface.
+	(merge_face_vectors): Don't do :ignore-defface overwriting here.
+	(Finternal_merge_in_global_face): Do it here.
 
 2005-11-20  Juri Linkov  <juri@jurta.org>
 
--- a/src/xfaces.c	Sun Nov 20 19:21:20 2005 +0000
+++ b/src/xfaces.c	Sun Nov 20 22:35:48 2005 +0000
@@ -3576,8 +3576,6 @@
       {
 	if (i == LFACE_HEIGHT_INDEX && !INTEGERP (from[i]))
 	  to[i] = merge_face_heights (from[i], to[i], to[i]);
-	else if (IGNORE_DEFFACE_P (from[i]))
-	  to[i] = Qunspecified;
 	else
 	  to[i] = from[i];
       }
@@ -4056,8 +4054,15 @@
   if (EQ (frame, Qt))
     {
       lface = lface_from_face_name (NULL, face, 1);
+
+      /* When updating face-new-frame-defaults, we put :ignore-defface
+	 where the caller wants `unspecified'.  This forces the frame
+	 defaults to ignore the defface value.  Otherwise, the defface
+	 will take effect, which is generally not what is intended.
+	 The value of that attribute will be inherited from some other
+	 face during face merging.  See internal_merge_in_global_face. */
       if (UNSPECIFIEDP (value))
-	value = Qignore_defface;
+      	value = Qignore_defface;
     }
   else
     {
@@ -4969,7 +4974,10 @@
   gvec = XVECTOR (global_lface)->contents;
   for (i = 1; i < LFACE_VECTOR_SIZE; ++i)
     if (! UNSPECIFIEDP (gvec[i]))
-      lvec[i] = gvec[i];
+      if (IGNORE_DEFFACE_P (gvec[i]))
+	lvec[i] = Qunspecified;
+      else
+	lvec[i] = gvec[i];
 
   return Qnil;
 }