comparison src/xfaces.c @ 31221:5bd6bdf3d3cf

(merge_face_vectors): Clear TO's :font attribute if made inconsistent by a font-related attribute in FROM. (merge_face_inheritance): Add function comment.
author Miles Bader <miles@gnu.org>
date Mon, 28 Aug 2000 14:41:55 +0000
parents 1733db535955
children 2be1770112c1
comparison
equal deleted inserted replaced
31220:e947c5224fc0 31221:5bd6bdf3d3cf
3148 other code uses `unspecified' as a generic value for face attributes. */ 3148 other code uses `unspecified' as a generic value for face attributes. */
3149 if (!UNSPECIFIEDP (from[LFACE_INHERIT_INDEX]) 3149 if (!UNSPECIFIEDP (from[LFACE_INHERIT_INDEX])
3150 && !NILP (from[LFACE_INHERIT_INDEX])) 3150 && !NILP (from[LFACE_INHERIT_INDEX]))
3151 merge_face_inheritance (f, from[LFACE_INHERIT_INDEX], to, cycle_check); 3151 merge_face_inheritance (f, from[LFACE_INHERIT_INDEX], to, cycle_check);
3152 3152
3153 /* If TO specifies a :font attribute, and FROM specifies some
3154 font-related attribute, we need to clear TO's :font attribute
3155 (because it will be inconsistent with whatever FROM specifies, and
3156 FROM takes precedence). */
3157 if (!NILP (to[LFACE_FONT_INDEX])
3158 && (!UNSPECIFIEDP (from[LFACE_FAMILY_INDEX])
3159 || !UNSPECIFIEDP (from[LFACE_HEIGHT_INDEX])
3160 || !UNSPECIFIEDP (from[LFACE_WEIGHT_INDEX])
3161 || !UNSPECIFIEDP (from[LFACE_SLANT_INDEX])
3162 || !UNSPECIFIEDP (from[LFACE_SWIDTH_INDEX])))
3163 to[LFACE_FONT_INDEX] = Qnil;
3164
3153 for (i = 1; i < LFACE_VECTOR_SIZE; ++i) 3165 for (i = 1; i < LFACE_VECTOR_SIZE; ++i)
3154 if (!UNSPECIFIEDP (from[i])) 3166 if (!UNSPECIFIEDP (from[i]))
3155 if (i == LFACE_HEIGHT_INDEX && !INTEGERP (from[i])) 3167 if (i == LFACE_HEIGHT_INDEX && !INTEGERP (from[i]))
3156 to[i] = merge_face_heights (from[i], to[i], to[i], cycle_check); 3168 to[i] = merge_face_heights (from[i], to[i], to[i], cycle_check);
3157 else 3169 else
3184 ? make_number (XFASTINT (check) + 1) \ 3196 ? make_number (XFASTINT (check) + 1) \
3185 : Fcons (el, Qnil)) \ 3197 : Fcons (el, Qnil)) \
3186 : Fmemq ((el), (check)) \ 3198 : Fmemq ((el), (check)) \
3187 ? Qnil \ 3199 ? Qnil \
3188 : Fcons ((el), (check))) 3200 : Fcons ((el), (check)))
3201
3202
3203 /* Merge face attributes from the face on frame F whose name is
3204 INHERITS, into the vector of face attributes TO; INHERITS may also be
3205 a list of face names, in which case they are applied in order.
3206 CYCLE_CHECK is used to detect loops in face inheritance.
3207 Returns true if any of the inherited attributes are `font-related'. */
3189 3208
3190 static void 3209 static void
3191 merge_face_inheritance (f, inherit, to, cycle_check) 3210 merge_face_inheritance (f, inherit, to, cycle_check)
3192 struct frame *f; 3211 struct frame *f;
3193 Lisp_Object inherit; 3212 Lisp_Object inherit;