summaryrefslogtreecommitdiff
path: root/src/xfaces.c
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2005-01-10 13:35:11 +0000
committerKim F. Storm <storm@cua.dk>2005-01-10 13:35:11 +0000
commitdc91a0ed800ec66f7bdcdd67e59b8565fd52be45 (patch)
treee57553e725002fad441be7931d326d204a395539 /src/xfaces.c
parent539f1217675895e849df3cee5c95a9ea4e36071e (diff)
downloademacs-dc91a0ed800ec66f7bdcdd67e59b8565fd52be45.tar.gz
(merge_faces): Rename from merge_into_realized_face.
Callers changed. Add support to merge with lisp face id too (if face_name is t).
Diffstat (limited to 'src/xfaces.c')
-rw-r--r--src/xfaces.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/xfaces.c b/src/xfaces.c
index c6dff0bae7f..7aa66735db6 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -7691,16 +7691,19 @@ face_at_string_position (w, string, pos, bufpos, region_beg,
F is frame where faces are (to be) realized.
- FACE_NAME is named face to merge, or if nil,
- FACE_ID is face_id of realized face to merge.
+ FACE_NAME is named face to merge.
+
+ If FACE_NAME is nil, FACE_ID is face_id of realized face to merge.
+
+ If FACE_NAME is t, FACE_ID is lface_id of face to merge.
BASE_FACE_ID is realized face to merge into.
- Return new face.
+ Return new face id.
*/
int
-merge_into_realized_face (f, face_name, face_id, base_face_id)
+merge_faces (f, face_name, face_id, base_face_id)
struct frame *f;
Lisp_Object face_name;
int face_id, base_face_id;
@@ -7712,6 +7715,17 @@ merge_into_realized_face (f, face_name, face_id, base_face_id)
if (!base_face)
return base_face_id;
+ if (EQ (face_name, Qt))
+ {
+ if (face_id < 0 || face_id >= lface_id_to_name_size)
+ return base_face_id;
+ face_name = lface_id_to_name[face_id];
+ face_id = lookup_derived_face (f, face_name, 0, base_face_id);
+ if (face_id >= 0)
+ return face_id;
+ return base_face_id;
+ }
+
/* Begin with attributes from the base face. */
bcopy (base_face->lface, attrs, sizeof attrs);
@@ -7723,6 +7737,8 @@ merge_into_realized_face (f, face_name, face_id, base_face_id)
else
{
struct face *face;
+ if (face_id < 0)
+ return base_face_id;
face = FACE_FROM_ID (f, face_id);
if (!face)
return base_face_id;