comparison src/xfaces.c @ 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 095993a59ddd
children c5ff1098b0b8 69e184bbba16
comparison
equal deleted inserted replaced
67055:c6ae377fa1f0 67056:3ce17ff4a61f
3574 for (i = 1; i < LFACE_VECTOR_SIZE; ++i) 3574 for (i = 1; i < LFACE_VECTOR_SIZE; ++i)
3575 if (!UNSPECIFIEDP (from[i])) 3575 if (!UNSPECIFIEDP (from[i]))
3576 { 3576 {
3577 if (i == LFACE_HEIGHT_INDEX && !INTEGERP (from[i])) 3577 if (i == LFACE_HEIGHT_INDEX && !INTEGERP (from[i]))
3578 to[i] = merge_face_heights (from[i], to[i], to[i]); 3578 to[i] = merge_face_heights (from[i], to[i], to[i]);
3579 else if (IGNORE_DEFFACE_P (from[i]))
3580 to[i] = Qunspecified;
3581 else 3579 else
3582 to[i] = from[i]; 3580 to[i] = from[i];
3583 } 3581 }
3584 3582
3585 /* TO is always an absolute face, which should inherit from nothing. 3583 /* TO is always an absolute face, which should inherit from nothing.
4054 4052
4055 /* Set lface to the Lisp attribute vector of FACE. */ 4053 /* Set lface to the Lisp attribute vector of FACE. */
4056 if (EQ (frame, Qt)) 4054 if (EQ (frame, Qt))
4057 { 4055 {
4058 lface = lface_from_face_name (NULL, face, 1); 4056 lface = lface_from_face_name (NULL, face, 1);
4057
4058 /* When updating face-new-frame-defaults, we put :ignore-defface
4059 where the caller wants `unspecified'. This forces the frame
4060 defaults to ignore the defface value. Otherwise, the defface
4061 will take effect, which is generally not what is intended.
4062 The value of that attribute will be inherited from some other
4063 face during face merging. See internal_merge_in_global_face. */
4059 if (UNSPECIFIEDP (value)) 4064 if (UNSPECIFIEDP (value))
4060 value = Qignore_defface; 4065 value = Qignore_defface;
4061 } 4066 }
4062 else 4067 else
4063 { 4068 {
4064 if (NILP (frame)) 4069 if (NILP (frame))
4065 frame = selected_frame; 4070 frame = selected_frame;
4967 "global before local" priority. */ 4972 "global before local" priority. */
4968 lvec = XVECTOR (local_lface)->contents; 4973 lvec = XVECTOR (local_lface)->contents;
4969 gvec = XVECTOR (global_lface)->contents; 4974 gvec = XVECTOR (global_lface)->contents;
4970 for (i = 1; i < LFACE_VECTOR_SIZE; ++i) 4975 for (i = 1; i < LFACE_VECTOR_SIZE; ++i)
4971 if (! UNSPECIFIEDP (gvec[i])) 4976 if (! UNSPECIFIEDP (gvec[i]))
4972 lvec[i] = gvec[i]; 4977 if (IGNORE_DEFFACE_P (gvec[i]))
4978 lvec[i] = Qunspecified;
4979 else
4980 lvec[i] = gvec[i];
4973 4981
4974 return Qnil; 4982 return Qnil;
4975 } 4983 }
4976 4984
4977 4985