aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiles Bader2000-08-28 14:42:49 +0000
committerMiles Bader2000-08-28 14:42:49 +0000
commit871882002ae8ec8d2e2c465cf228dc915420fb51 (patch)
tree1e30133ff6a3626daa6792cebe13f50432a64f5e /src
parent82a452c8569260a94594452b29ed0b42a4c1f1ae (diff)
downloademacs-871882002ae8ec8d2e2c465cf228dc915420fb51.tar.gz
emacs-871882002ae8ec8d2e2c465cf228dc915420fb51.zip
(merge_face_vectors):
Clear TO's :font attribute if made inconsistent by a font-related attribute in FROM. (merge_face_inheritance): Add function comment.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/xfaces.c19
2 files changed, 25 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 69be13105dc..7a82c85e0e8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12000-08-28 Miles Bader <miles@gnu.org>
2
3 * xfaces.c (merge_face_vectors): Clear TO's :font attribute if
4 made inconsistent by a font-related attribute in FROM.
5 (merge_face_inheritance): Add function comment.
6
12000-08-28 Kenichi Handa <handa@etl.go.jp> 72000-08-28 Kenichi Handa <handa@etl.go.jp>
2 8
3 * keyboard.c (read_char_minibuf_menu_prompt): Call read_char with 9 * keyboard.c (read_char_minibuf_menu_prompt): Call read_char with
diff --git a/src/xfaces.c b/src/xfaces.c
index 17f9c5928bb..c75534b30e5 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -3150,6 +3150,18 @@ merge_face_vectors (f, from, to, cycle_check)
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]))
@@ -3187,6 +3199,13 @@ merge_face_vectors (f, from, to, cycle_check)
3187 ? Qnil \ 3199 ? Qnil \
3188 : Fcons ((el), (check))) 3200 : Fcons ((el), (check)))
3189 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'. */
3208
3190static void 3209static void
3191merge_face_inheritance (f, inherit, to, cycle_check) 3210merge_face_inheritance (f, inherit, to, cycle_check)
3192 struct frame *f; 3211 struct frame *f;