# HG changeset patch # User Richard M. Stallman # Date 776235117 0 # Node ID 0d0b32e78a5b8b26f8e57981d16ee7905a25ae84 # Parent 64c299dd51b8e61f061a5f6159ff3af466d3ba26 (compute_glyph_face_1): New function. diff -r 64c299dd51b8 -r 0d0b32e78a5b src/xfaces.c --- a/src/xfaces.c Sun Aug 07 04:50:05 1994 +0000 +++ b/src/xfaces.c Sun Aug 07 04:51:57 1994 +0000 @@ -743,6 +743,31 @@ return intern_computed_face (f, &face); } + +/* Return the face ID to use to display a special glyph which selects + FACE_CODE as the face ID, assuming that ordinarily the face would + be CURRENT_FACE. F is the frame. */ + +int +compute_glyph_face_1 (f, face_name, current_face) + struct frame *f; + Lisp_Object face_name; + int current_face; +{ + struct face face; + + face = *FRAME_COMPUTED_FACES (f)[current_face]; + + if (!NILP (face_name)) + { + int facecode = face_name_id_number (f, face_name); + if (facecode >= 0 && facecode < FRAME_N_PARAM_FACES (f) + && FRAME_PARAM_FACES (f) [facecode] != 0) + merge_faces (FRAME_PARAM_FACES (f) [facecode], &face); + } + + return intern_computed_face (f, &face); +} /* Return the face ID associated with a buffer position POS. Store into *ENDPTR the position at which a different face is needed.