Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
48a4ca99
Commit
48a4ca99
authored
Mar 08, 2001
by
Gerd Moellmann
Browse files
(face_at_string_position): Add parameter MOUSE_P.
Handle `mouse-face'.
parent
8d721a0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
src/xfaces.c
src/xfaces.c
+7
-3
No files found.
src/xfaces.c
View file @
48a4ca99
...
...
@@ -6889,6 +6889,8 @@ face_at_buffer_position (w, pos, region_beg, region_end,
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 @@ face_at_buffer_position (w, pos, region_beg, region_end,
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
,
Qfac
e
,
string
);
prop = Fget_text_property (position,
prop_nam
e, 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 @@ face_at_string_position (w, string, pos, bufpos, region_beg,
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
,
Qfac
e
,
string
,
limit
);
end = Fnext_single_property_change (position,
prop_nam
e, string, limit);
if (INTEGERP (end))
*endptr = XFASTINT (end);
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment