aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2000-08-29 11:18:16 +0000
committerMiles Bader2000-08-29 11:18:16 +0000
commit613fa7f2bda99a6b65e2354e609a145ebafa5dea (patch)
tree0a99cf04ed1ac951e93c65a1eac5a9563c81c13f
parent25db2767face977e16ef580bd72a8226445f9b92 (diff)
downloademacs-613fa7f2bda99a6b65e2354e609a145ebafa5dea.tar.gz
emacs-613fa7f2bda99a6b65e2354e609a145ebafa5dea.zip
(default_face_vector): New function.
(Finternal_merge_in_global_face): Use it instead of merge_face_vectors.
-rw-r--r--src/xfaces.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/src/xfaces.c b/src/xfaces.c
index c75534b30e5..31611082680 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -504,6 +504,7 @@ static int face_numeric_slant P_ ((Lisp_Object));
504static int face_numeric_swidth P_ ((Lisp_Object)); 504static int face_numeric_swidth P_ ((Lisp_Object));
505static int face_fontset P_ ((Lisp_Object *)); 505static int face_fontset P_ ((Lisp_Object *));
506static char *choose_face_font P_ ((struct frame *, Lisp_Object *, int, int)); 506static char *choose_face_font P_ ((struct frame *, Lisp_Object *, int, int));
507static void default_face_vector P_ ((Lisp_Object *, Lisp_Object*));
507static void merge_face_vectors P_ ((struct frame *, Lisp_Object *, Lisp_Object*, Lisp_Object)); 508static void merge_face_vectors P_ ((struct frame *, Lisp_Object *, Lisp_Object*, Lisp_Object));
508static void merge_face_inheritance P_ ((struct frame *f, Lisp_Object, 509static void merge_face_inheritance P_ ((struct frame *f, Lisp_Object,
509 Lisp_Object *, Lisp_Object)); 510 Lisp_Object *, Lisp_Object));
@@ -3127,11 +3128,29 @@ merge_face_heights (from, to, invalid, gcpro)
3127} 3128}
3128 3129
3129 3130
3131/* Default any unspecified face attributes in LFACE from DEFAULTS.
3132 Unlike merge_face_vectors, below, this function simply fills in any
3133 unspecified attributes in LFACE from the those in DEFAULTS, and will
3134 not do face inheritance or make relative attributes absolute. */
3135
3136static INLINE void
3137default_face_vector (lface, defaults)
3138 Lisp_Object *lface, *defaults;
3139{
3140 int i;
3141 for (i = 1; i < LFACE_VECTOR_SIZE; ++i)
3142 if (UNSPECIFIEDP (lface[i]))
3143 lface[i] = defaults[i];
3144}
3145
3146
3130/* Merge two Lisp face attribute vectors on frame F, FROM and TO, and 3147/* Merge two Lisp face attribute vectors on frame F, FROM and TO, and
3131 store the resulting attributes in TO. Every non-nil attribute of 3148 store the resulting attributes in TO, which must be already be
3132 FROM overrides the corresponding attribute of TO. CYCLE_CHECK is 3149 completely specified and contain only absolute attributes. Every
3133 used internally to detect loops in face inheritance; it should be 3150 specified attribute of FROM overrides the corresponding attribute of
3134 Qnil when called from other places. */ 3151 TO; relative attributes in FROM are merged with the absolute value in
3152 TO and replace it. CYCLE_CHECK is used internally to detect loops in
3153 face inheritance; it should be Qnil when called from other places. */
3135 3154
3136static INLINE void 3155static INLINE void
3137merge_face_vectors (f, from, to, cycle_check) 3156merge_face_vectors (f, from, to, cycle_check)
@@ -4547,10 +4566,8 @@ DEFUN ("internal-merge-in-global-face", Finternal_merge_in_global_face,
4547 local_lface = lface_from_face_name (XFRAME (frame), face, 0); 4566 local_lface = lface_from_face_name (XFRAME (frame), face, 0);
4548 if (NILP (local_lface)) 4567 if (NILP (local_lface))
4549 local_lface = Finternal_make_lisp_face (face, frame); 4568 local_lface = Finternal_make_lisp_face (face, frame);
4550 merge_face_vectors (XFRAME (frame), 4569 default_face_vector (XVECTOR (local_lface)->contents,
4551 XVECTOR (global_lface)->contents, 4570 XVECTOR (global_lface)->contents);
4552 XVECTOR (local_lface)->contents,
4553 Qnil);
4554 return face; 4571 return face;
4555} 4572}
4556 4573