diff options
| author | Gerd Moellmann | 2001-03-08 20:55:20 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-03-08 20:55:20 +0000 |
| commit | 48a4ca998539a17fc6d85a5f7dcc1deb8c7901b6 (patch) | |
| tree | 7e0286253de215edad6b7ea3cd969d3cf12412ee /src | |
| parent | 8d721a0d0ca0effb77e18bdbeafdbe5c490e3550 (diff) | |
| download | emacs-48a4ca998539a17fc6d85a5f7dcc1deb8c7901b6.tar.gz emacs-48a4ca998539a17fc6d85a5f7dcc1deb8c7901b6.zip | |
(face_at_string_position): Add parameter MOUSE_P.
Handle `mouse-face'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfaces.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index b11a7d467de..79c07804363 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -6889,6 +6889,8 @@ face_at_buffer_position (w, pos, region_beg, region_end, | |||
| 6889 | BASE_FACE_ID is the id of a face to merge with. For strings coming | 6889 | BASE_FACE_ID is the id of a face to merge with. For strings coming |
| 6890 | from overlays or the `display' property it is the face at BUFPOS. | 6890 | from overlays or the `display' property it is the face at BUFPOS. |
| 6891 | 6891 | ||
| 6892 | If MOUSE_P is non-zero, use the character's mouse-face, not its face. | ||
| 6893 | |||
| 6892 | Set *ENDPTR to the next position where to check for faces in | 6894 | Set *ENDPTR to the next position where to check for faces in |
| 6893 | STRING; -1 if the face is constant from POS to the end of the | 6895 | STRING; -1 if the face is constant from POS to the end of the |
| 6894 | string. | 6896 | string. |
| @@ -6898,24 +6900,26 @@ face_at_buffer_position (w, pos, region_beg, region_end, | |||
| 6898 | 6900 | ||
| 6899 | int | 6901 | int |
| 6900 | face_at_string_position (w, string, pos, bufpos, region_beg, | 6902 | face_at_string_position (w, string, pos, bufpos, region_beg, |
| 6901 | region_end, endptr, base_face_id) | 6903 | region_end, endptr, base_face_id, mouse_p) |
| 6902 | struct window *w; | 6904 | struct window *w; |
| 6903 | Lisp_Object string; | 6905 | Lisp_Object string; |
| 6904 | int pos, bufpos; | 6906 | int pos, bufpos; |
| 6905 | int region_beg, region_end; | 6907 | int region_beg, region_end; |
| 6906 | int *endptr; | 6908 | int *endptr; |
| 6907 | enum face_id base_face_id; | 6909 | enum face_id base_face_id; |
| 6910 | int mouse_p; | ||
| 6908 | { | 6911 | { |
| 6909 | Lisp_Object prop, position, end, limit; | 6912 | Lisp_Object prop, position, end, limit; |
| 6910 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 6913 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 6911 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; | 6914 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; |
| 6912 | struct face *base_face; | 6915 | struct face *base_face; |
| 6913 | int multibyte_p = STRING_MULTIBYTE (string); | 6916 | int multibyte_p = STRING_MULTIBYTE (string); |
| 6917 | Lisp_Object prop_name = mouse_p ? Qmouse_face : Qface; | ||
| 6914 | 6918 | ||
| 6915 | /* Get the value of the face property at the current position within | 6919 | /* Get the value of the face property at the current position within |
| 6916 | STRING. Value is nil if there is no face property. */ | 6920 | STRING. Value is nil if there is no face property. */ |
| 6917 | XSETFASTINT (position, pos); | 6921 | XSETFASTINT (position, pos); |
| 6918 | prop = Fget_text_property (position, Qface, string); | 6922 | prop = Fget_text_property (position, prop_name, string); |
| 6919 | 6923 | ||
| 6920 | /* Get the next position at which to check for faces. Value of end | 6924 | /* Get the next position at which to check for faces. Value of end |
| 6921 | is nil if face is constant all the way to the end of the string. | 6925 | is nil if face is constant all the way to the end of the string. |
| @@ -6924,7 +6928,7 @@ face_at_string_position (w, string, pos, bufpos, region_beg, | |||
| 6924 | changes in Fnext_single_property_change. Strings are usually | 6928 | changes in Fnext_single_property_change. Strings are usually |
| 6925 | short, so set the limit to the end of the string. */ | 6929 | short, so set the limit to the end of the string. */ |
| 6926 | XSETFASTINT (limit, XSTRING (string)->size); | 6930 | XSETFASTINT (limit, XSTRING (string)->size); |
| 6927 | end = Fnext_single_property_change (position, Qface, string, limit); | 6931 | end = Fnext_single_property_change (position, prop_name, string, limit); |
| 6928 | if (INTEGERP (end)) | 6932 | if (INTEGERP (end)) |
| 6929 | *endptr = XFASTINT (end); | 6933 | *endptr = XFASTINT (end); |
| 6930 | else | 6934 | else |