diff options
| author | Kim F. Storm | 2005-01-10 13:35:11 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2005-01-10 13:35:11 +0000 |
| commit | dc91a0ed800ec66f7bdcdd67e59b8565fd52be45 (patch) | |
| tree | e57553e725002fad441be7931d326d204a395539 /src/xfaces.c | |
| parent | 539f1217675895e849df3cee5c95a9ea4e36071e (diff) | |
| download | emacs-dc91a0ed800ec66f7bdcdd67e59b8565fd52be45.tar.gz emacs-dc91a0ed800ec66f7bdcdd67e59b8565fd52be45.zip | |
(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.c | 24 |
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, | |||
| 7691 | 7691 | ||
| 7692 | F is frame where faces are (to be) realized. | 7692 | F is frame where faces are (to be) realized. |
| 7693 | 7693 | ||
| 7694 | FACE_NAME is named face to merge, or if nil, | 7694 | FACE_NAME is named face to merge. |
| 7695 | FACE_ID is face_id of realized face to merge. | 7695 | |
| 7696 | If FACE_NAME is nil, FACE_ID is face_id of realized face to merge. | ||
| 7697 | |||
| 7698 | If FACE_NAME is t, FACE_ID is lface_id of face to merge. | ||
| 7696 | 7699 | ||
| 7697 | BASE_FACE_ID is realized face to merge into. | 7700 | BASE_FACE_ID is realized face to merge into. |
| 7698 | 7701 | ||
| 7699 | Return new face. | 7702 | Return new face id. |
| 7700 | */ | 7703 | */ |
| 7701 | 7704 | ||
| 7702 | int | 7705 | int |
| 7703 | merge_into_realized_face (f, face_name, face_id, base_face_id) | 7706 | merge_faces (f, face_name, face_id, base_face_id) |
| 7704 | struct frame *f; | 7707 | struct frame *f; |
| 7705 | Lisp_Object face_name; | 7708 | Lisp_Object face_name; |
| 7706 | int face_id, base_face_id; | 7709 | int face_id, base_face_id; |
| @@ -7712,6 +7715,17 @@ merge_into_realized_face (f, face_name, face_id, base_face_id) | |||
| 7712 | if (!base_face) | 7715 | if (!base_face) |
| 7713 | return base_face_id; | 7716 | return base_face_id; |
| 7714 | 7717 | ||
| 7718 | if (EQ (face_name, Qt)) | ||
| 7719 | { | ||
| 7720 | if (face_id < 0 || face_id >= lface_id_to_name_size) | ||
| 7721 | return base_face_id; | ||
| 7722 | face_name = lface_id_to_name[face_id]; | ||
| 7723 | face_id = lookup_derived_face (f, face_name, 0, base_face_id); | ||
| 7724 | if (face_id >= 0) | ||
| 7725 | return face_id; | ||
| 7726 | return base_face_id; | ||
| 7727 | } | ||
| 7728 | |||
| 7715 | /* Begin with attributes from the base face. */ | 7729 | /* Begin with attributes from the base face. */ |
| 7716 | bcopy (base_face->lface, attrs, sizeof attrs); | 7730 | bcopy (base_face->lface, attrs, sizeof attrs); |
| 7717 | 7731 | ||
| @@ -7723,6 +7737,8 @@ merge_into_realized_face (f, face_name, face_id, base_face_id) | |||
| 7723 | else | 7737 | else |
| 7724 | { | 7738 | { |
| 7725 | struct face *face; | 7739 | struct face *face; |
| 7740 | if (face_id < 0) | ||
| 7741 | return base_face_id; | ||
| 7726 | face = FACE_FROM_ID (f, face_id); | 7742 | face = FACE_FROM_ID (f, face_id); |
| 7727 | if (!face) | 7743 | if (!face) |
| 7728 | return base_face_id; | 7744 | return base_face_id; |