Mercurial > emacs
changeset 36672:acf152adbf82
(face_at_string_position): Add parameter MOUSE_P.
Handle `mouse-face'.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Thu, 08 Mar 2001 20:55:20 +0000 |
parents | b5aa229bcb18 |
children | e3523940caad |
files | src/xfaces.c |
diffstat | 1 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xfaces.c Thu Mar 08 20:54:50 2001 +0000 +++ b/src/xfaces.c Thu Mar 08 20:55:20 2001 +0000 @@ -6889,6 +6889,8 @@ BASE_FACE_ID is the id of a face to merge with. For strings coming from overlays or the `display' property it is the face at BUFPOS. + If MOUSE_P is non-zero, use the character's mouse-face, not its face. + Set *ENDPTR to the next position where to check for faces in STRING; -1 if the face is constant from POS to the end of the string. @@ -6898,24 +6900,26 @@ int face_at_string_position (w, string, pos, bufpos, region_beg, - region_end, endptr, base_face_id) + region_end, endptr, base_face_id, mouse_p) struct window *w; Lisp_Object string; int pos, bufpos; int region_beg, region_end; int *endptr; enum face_id base_face_id; + int mouse_p; { Lisp_Object prop, position, end, limit; struct frame *f = XFRAME (WINDOW_FRAME (w)); Lisp_Object attrs[LFACE_VECTOR_SIZE]; struct face *base_face; int multibyte_p = STRING_MULTIBYTE (string); + Lisp_Object prop_name = mouse_p ? Qmouse_face : Qface; /* Get the value of the face property at the current position within STRING. Value is nil if there is no face property. */ XSETFASTINT (position, pos); - prop = Fget_text_property (position, Qface, string); + prop = Fget_text_property (position, prop_name, string); /* Get the next position at which to check for faces. Value of end is nil if face is constant all the way to the end of the string. @@ -6924,7 +6928,7 @@ changes in Fnext_single_property_change. Strings are usually short, so set the limit to the end of the string. */ XSETFASTINT (limit, XSTRING (string)->size); - end = Fnext_single_property_change (position, Qface, string, limit); + end = Fnext_single_property_change (position, prop_name, string, limit); if (INTEGERP (end)) *endptr = XFASTINT (end); else