Mercurial > emacs
comparison src/xfaces.c @ 31259:2be1770112c1
(default_face_vector): New function.
(Finternal_merge_in_global_face): Use it instead of merge_face_vectors.
author | Miles Bader <miles@gnu.org> |
---|---|
date | Tue, 29 Aug 2000 11:18:16 +0000 |
parents | 5bd6bdf3d3cf |
children | b176433657cc |
comparison
equal
deleted
inserted
replaced
31258:12f2e341ee9c | 31259:2be1770112c1 |
---|---|
502 static int face_numeric_weight P_ ((Lisp_Object)); | 502 static int face_numeric_weight P_ ((Lisp_Object)); |
503 static int face_numeric_slant P_ ((Lisp_Object)); | 503 static int face_numeric_slant P_ ((Lisp_Object)); |
504 static int face_numeric_swidth P_ ((Lisp_Object)); | 504 static int face_numeric_swidth P_ ((Lisp_Object)); |
505 static int face_fontset P_ ((Lisp_Object *)); | 505 static int face_fontset P_ ((Lisp_Object *)); |
506 static char *choose_face_font P_ ((struct frame *, Lisp_Object *, int, int)); | 506 static char *choose_face_font P_ ((struct frame *, Lisp_Object *, int, int)); |
507 static void default_face_vector P_ ((Lisp_Object *, Lisp_Object*)); | |
507 static void merge_face_vectors P_ ((struct frame *, Lisp_Object *, Lisp_Object*, Lisp_Object)); | 508 static void merge_face_vectors P_ ((struct frame *, Lisp_Object *, Lisp_Object*, Lisp_Object)); |
508 static void merge_face_inheritance P_ ((struct frame *f, Lisp_Object, | 509 static void merge_face_inheritance P_ ((struct frame *f, Lisp_Object, |
509 Lisp_Object *, Lisp_Object)); | 510 Lisp_Object *, Lisp_Object)); |
510 static void merge_face_vector_with_property P_ ((struct frame *, Lisp_Object *, | 511 static void merge_face_vector_with_property P_ ((struct frame *, Lisp_Object *, |
511 Lisp_Object)); | 512 Lisp_Object)); |
3125 else | 3126 else |
3126 return invalid; | 3127 return invalid; |
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 | |
3136 static INLINE void | |
3137 default_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 |
3136 static INLINE void | 3155 static INLINE void |
3137 merge_face_vectors (f, from, to, cycle_check) | 3156 merge_face_vectors (f, from, to, cycle_check) |
3138 struct frame *f; | 3157 struct frame *f; |
3139 Lisp_Object *from, *to; | 3158 Lisp_Object *from, *to; |
4545 CHECK_LIVE_FRAME (frame, 1); | 4564 CHECK_LIVE_FRAME (frame, 1); |
4546 global_lface = lface_from_face_name (NULL, face, 1); | 4565 global_lface = lface_from_face_name (NULL, face, 1); |
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 |
4557 | 4574 |
4558 /* The following function is implemented for compatibility with 20.2. | 4575 /* The following function is implemented for compatibility with 20.2. |