mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-08 15:35:02 +00:00
Added parameter attr_filter to face_at_string_position.
Update all the occurrences in src/xdisp.c and src/xfaces.c
This commit is contained in:
parent
e1b5e80aad
commit
2b80b4dc46
@ -3559,7 +3559,8 @@ int face_at_buffer_position (struct window *, ptrdiff_t, ptrdiff_t *,
|
|||||||
int face_for_overlay_string (struct window *, ptrdiff_t, ptrdiff_t *, ptrdiff_t,
|
int face_for_overlay_string (struct window *, ptrdiff_t, ptrdiff_t *, ptrdiff_t,
|
||||||
bool, Lisp_Object);
|
bool, Lisp_Object);
|
||||||
int face_at_string_position (struct window *, Lisp_Object, ptrdiff_t, ptrdiff_t,
|
int face_at_string_position (struct window *, Lisp_Object, ptrdiff_t, ptrdiff_t,
|
||||||
ptrdiff_t *, enum face_id, bool);
|
ptrdiff_t *, enum face_id, bool,
|
||||||
|
enum lface_attribute_index);
|
||||||
int merge_faces (struct window *, Lisp_Object, int, int);
|
int merge_faces (struct window *, Lisp_Object, int, int);
|
||||||
int compute_char_face (struct frame *, int, Lisp_Object);
|
int compute_char_face (struct frame *, int, Lisp_Object);
|
||||||
void free_all_realized_faces (Lisp_Object);
|
void free_all_realized_faces (Lisp_Object);
|
||||||
|
@ -3785,7 +3785,7 @@ font_at (int c, ptrdiff_t pos, struct face *face, struct window *w,
|
|||||||
|
|
||||||
if (STRINGP (string))
|
if (STRINGP (string))
|
||||||
face_id = face_at_string_position (w, string, pos, 0, &endptr,
|
face_id = face_at_string_position (w, string, pos, 0, &endptr,
|
||||||
DEFAULT_FACE_ID, 0);
|
DEFAULT_FACE_ID, false, 0);
|
||||||
else
|
else
|
||||||
face_id = face_at_buffer_position (w, pos, &endptr,
|
face_id = face_at_buffer_position (w, pos, &endptr,
|
||||||
pos + 100, false, -1, 0);
|
pos + 100, false, -1, 0);
|
||||||
@ -3841,7 +3841,7 @@ font_range (ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t *limit,
|
|||||||
: lookup_basic_face (w, f, DEFAULT_FACE_ID);
|
: lookup_basic_face (w, f, DEFAULT_FACE_ID);
|
||||||
|
|
||||||
face_id = face_at_string_position (w, string, pos, 0, &ignore,
|
face_id = face_at_string_position (w, string, pos, 0, &ignore,
|
||||||
face_id, false);
|
face_id, false, 0);
|
||||||
}
|
}
|
||||||
face = FACE_FROM_ID (f, face_id);
|
face = FACE_FROM_ID (f, face_id);
|
||||||
}
|
}
|
||||||
|
37
src/xdisp.c
37
src/xdisp.c
@ -4173,7 +4173,8 @@ handle_face_prop_general (struct it *it, int initial_face_id,
|
|||||||
&next_stop,
|
&next_stop,
|
||||||
(IT_CHARPOS (*it)
|
(IT_CHARPOS (*it)
|
||||||
+ TEXT_PROP_DISTANCE_LIMIT),
|
+ TEXT_PROP_DISTANCE_LIMIT),
|
||||||
false, it->base_face_id, attr_filter);
|
false, it->base_face_id,
|
||||||
|
attr_filter);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -4218,7 +4219,7 @@ handle_face_prop_general (struct it *it, int initial_face_id,
|
|||||||
(IT_CHARPOS (*it)
|
(IT_CHARPOS (*it)
|
||||||
+ TEXT_PROP_DISTANCE_LIMIT),
|
+ TEXT_PROP_DISTANCE_LIMIT),
|
||||||
false,
|
false,
|
||||||
from_overlay);
|
from_overlay);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -4252,7 +4253,8 @@ handle_face_prop_general (struct it *it, int initial_face_id,
|
|||||||
IT_STRING_CHARPOS (*it),
|
IT_STRING_CHARPOS (*it),
|
||||||
bufpos,
|
bufpos,
|
||||||
&next_stop,
|
&next_stop,
|
||||||
base_face_id, false);
|
base_face_id, false,
|
||||||
|
attr_filter);
|
||||||
} /* !is_string. */
|
} /* !is_string. */
|
||||||
|
|
||||||
/* Is this a start of a run of characters with box face?
|
/* Is this a start of a run of characters with box face?
|
||||||
@ -4422,12 +4424,9 @@ face_before_or_after_it_pos (struct it *it, bool before_p)
|
|||||||
base_face_id = underlying_face_id (it);
|
base_face_id = underlying_face_id (it);
|
||||||
|
|
||||||
/* Get the face for ASCII, or unibyte. */
|
/* Get the face for ASCII, or unibyte. */
|
||||||
face_id = face_at_string_position (it->w,
|
face_id = face_at_string_position (it->w, it->string, charpos,
|
||||||
it->string,
|
bufpos, &next_check_charpos,
|
||||||
charpos,
|
base_face_id, false, 0);
|
||||||
bufpos,
|
|
||||||
&next_check_charpos,
|
|
||||||
base_face_id, false);
|
|
||||||
|
|
||||||
/* Correct the face for charsets different from ASCII. Do it
|
/* Correct the face for charsets different from ASCII. Do it
|
||||||
for the multibyte case only. The face returned above is
|
for the multibyte case only. The face returned above is
|
||||||
@ -7637,7 +7636,8 @@ get_next_display_element (struct it *it)
|
|||||||
next_face_id
|
next_face_id
|
||||||
= face_at_string_position (it->w, base_string,
|
= face_at_string_position (it->w, base_string,
|
||||||
CHARPOS (pos), 0,
|
CHARPOS (pos), 0,
|
||||||
&ignore, face_id, false);
|
&ignore, face_id,
|
||||||
|
false, 0);
|
||||||
it->end_of_box_run_p
|
it->end_of_box_run_p
|
||||||
= (FACE_FROM_ID (it->f, next_face_id)->box
|
= (FACE_FROM_ID (it->f, next_face_id)->box
|
||||||
== FACE_NO_BOX);
|
== FACE_NO_BOX);
|
||||||
@ -26569,8 +26569,8 @@ display_string (const char *string, Lisp_Object lisp_string, Lisp_Object face_st
|
|||||||
|
|
||||||
/* Initialize the iterator IT for iteration over STRING beginning
|
/* Initialize the iterator IT for iteration over STRING beginning
|
||||||
with index START. */
|
with index START. */
|
||||||
reseat_to_string (it, NILP (lisp_string) ? string : NULL, lisp_string, start,
|
reseat_to_string (it, NILP (lisp_string) ? string : NULL, lisp_string,
|
||||||
precision, field_width, multibyte);
|
start, precision, field_width, multibyte);
|
||||||
if (string && STRINGP (lisp_string))
|
if (string && STRINGP (lisp_string))
|
||||||
/* LISP_STRING is the one returned by decode_mode_spec. We should
|
/* LISP_STRING is the one returned by decode_mode_spec. We should
|
||||||
ignore its text properties. */
|
ignore its text properties. */
|
||||||
@ -26585,7 +26585,7 @@ display_string (const char *string, Lisp_Object lisp_string, Lisp_Object face_st
|
|||||||
|
|
||||||
it->face_id
|
it->face_id
|
||||||
= face_at_string_position (it->w, face_string, face_string_pos,
|
= face_at_string_position (it->w, face_string, face_string_pos,
|
||||||
0, &endptr, it->base_face_id, false);
|
0, &endptr, it->base_face_id, false, 0);
|
||||||
face = FACE_FROM_ID (it->f, it->face_id);
|
face = FACE_FROM_ID (it->f, it->face_id);
|
||||||
it->face_box_p = face->box != FACE_NO_BOX;
|
it->face_box_p = face->box != FACE_NO_BOX;
|
||||||
}
|
}
|
||||||
@ -32745,11 +32745,10 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
|
|||||||
hlinfo->mouse_face_past_end = false;
|
hlinfo->mouse_face_past_end = false;
|
||||||
hlinfo->mouse_face_window = window;
|
hlinfo->mouse_face_window = window;
|
||||||
|
|
||||||
hlinfo->mouse_face_face_id = face_at_string_position (w, string,
|
hlinfo->mouse_face_face_id =
|
||||||
charpos,
|
face_at_string_position (w, string, charpos, 0, &ignore,
|
||||||
0, &ignore,
|
glyph->face_id, true, 0);
|
||||||
glyph->face_id,
|
|
||||||
true);
|
|
||||||
show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
|
show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
|
||||||
mouse_face_shown = true;
|
mouse_face_shown = true;
|
||||||
|
|
||||||
@ -33175,7 +33174,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
|
|||||||
hlinfo->mouse_face_window = window;
|
hlinfo->mouse_face_window = window;
|
||||||
hlinfo->mouse_face_face_id
|
hlinfo->mouse_face_face_id
|
||||||
= face_at_string_position (w, object, pos, 0, &ignore,
|
= face_at_string_position (w, object, pos, 0, &ignore,
|
||||||
glyph->face_id, true);
|
glyph->face_id, true, 0);
|
||||||
show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
|
show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
|
||||||
cursor = No_Cursor;
|
cursor = No_Cursor;
|
||||||
}
|
}
|
||||||
|
@ -6275,9 +6275,10 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos,
|
|||||||
|
|
||||||
int
|
int
|
||||||
face_at_string_position (struct window *w, Lisp_Object string,
|
face_at_string_position (struct window *w, Lisp_Object string,
|
||||||
ptrdiff_t pos, ptrdiff_t bufpos,
|
ptrdiff_t pos, ptrdiff_t bufpos,
|
||||||
ptrdiff_t *endptr, enum face_id base_face_id,
|
ptrdiff_t *endptr, enum face_id base_face_id,
|
||||||
bool mouse_p)
|
bool mouse_p,
|
||||||
|
enum lface_attribute_index attr_filter)
|
||||||
{
|
{
|
||||||
Lisp_Object prop, position, end, limit;
|
Lisp_Object prop, position, end, limit;
|
||||||
struct frame *f = XFRAME (WINDOW_FRAME (w));
|
struct frame *f = XFRAME (WINDOW_FRAME (w));
|
||||||
@ -6321,7 +6322,7 @@ face_at_string_position (struct window *w, Lisp_Object string,
|
|||||||
|
|
||||||
/* Merge in attributes specified via text properties. */
|
/* Merge in attributes specified via text properties. */
|
||||||
if (!NILP (prop))
|
if (!NILP (prop))
|
||||||
merge_face_ref (w, f, prop, attrs, true, NULL, 0);
|
merge_face_ref (w, f, prop, attrs, true, NULL, attr_filter);
|
||||||
|
|
||||||
/* Look up a realized face with the given face attributes,
|
/* Look up a realized face with the given face attributes,
|
||||||
or realize a new one for ASCII characters. */
|
or realize a new one for ASCII characters. */
|
||||||
|
Loading…
Reference in New Issue
Block a user