aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJimmy Aguilar Mena2019-09-15 23:14:48 +0200
committerJimmy Aguilar Mena2019-10-14 14:18:41 +0200
commit2b80b4dc460c29096a39a5f3a6b474203599cfe7 (patch)
tree07a09341a8796c901c1a0f166e5cac06dfb85b20 /src
parente1b5e80aad46bba39831ae4c0aa863e69c915b4c (diff)
downloademacs-2b80b4dc460c29096a39a5f3a6b474203599cfe7.tar.gz
emacs-2b80b4dc460c29096a39a5f3a6b474203599cfe7.zip
Added parameter attr_filter to face_at_string_position.
Update all the occurrences in src/xdisp.c and src/xfaces.c
Diffstat (limited to 'src')
-rw-r--r--src/dispextern.h3
-rw-r--r--src/font.c4
-rw-r--r--src/xdisp.c37
-rw-r--r--src/xfaces.c9
4 files changed, 27 insertions, 26 deletions
diff --git a/src/dispextern.h b/src/dispextern.h
index 5db3ae88bf8..8bbabbe30dc 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3559,7 +3559,8 @@ int face_at_buffer_position (struct window *, ptrdiff_t, ptrdiff_t *,
3559int face_for_overlay_string (struct window *, ptrdiff_t, ptrdiff_t *, ptrdiff_t, 3559int face_for_overlay_string (struct window *, ptrdiff_t, ptrdiff_t *, ptrdiff_t,
3560 bool, Lisp_Object); 3560 bool, Lisp_Object);
3561int face_at_string_position (struct window *, Lisp_Object, ptrdiff_t, ptrdiff_t, 3561int face_at_string_position (struct window *, Lisp_Object, ptrdiff_t, ptrdiff_t,
3562 ptrdiff_t *, enum face_id, bool); 3562 ptrdiff_t *, enum face_id, bool,
3563 enum lface_attribute_index);
3563int merge_faces (struct window *, Lisp_Object, int, int); 3564int merge_faces (struct window *, Lisp_Object, int, int);
3564int compute_char_face (struct frame *, int, Lisp_Object); 3565int compute_char_face (struct frame *, int, Lisp_Object);
3565void free_all_realized_faces (Lisp_Object); 3566void free_all_realized_faces (Lisp_Object);
diff --git a/src/font.c b/src/font.c
index e1e33ab8b22..7fdadb17c14 100644
--- a/src/font.c
+++ b/src/font.c
@@ -3785,7 +3785,7 @@ font_at (int c, ptrdiff_t pos, struct face *face, struct window *w,
3785 3785
3786 if (STRINGP (string)) 3786 if (STRINGP (string))
3787 face_id = face_at_string_position (w, string, pos, 0, &endptr, 3787 face_id = face_at_string_position (w, string, pos, 0, &endptr,
3788 DEFAULT_FACE_ID, 0); 3788 DEFAULT_FACE_ID, false, 0);
3789 else 3789 else
3790 face_id = face_at_buffer_position (w, pos, &endptr, 3790 face_id = face_at_buffer_position (w, pos, &endptr,
3791 pos + 100, false, -1, 0); 3791 pos + 100, false, -1, 0);
@@ -3841,7 +3841,7 @@ font_range (ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t *limit,
3841 : lookup_basic_face (w, f, DEFAULT_FACE_ID); 3841 : lookup_basic_face (w, f, DEFAULT_FACE_ID);
3842 3842
3843 face_id = face_at_string_position (w, string, pos, 0, &ignore, 3843 face_id = face_at_string_position (w, string, pos, 0, &ignore,
3844 face_id, false); 3844 face_id, false, 0);
3845 } 3845 }
3846 face = FACE_FROM_ID (f, face_id); 3846 face = FACE_FROM_ID (f, face_id);
3847 } 3847 }
diff --git a/src/xdisp.c b/src/xdisp.c
index d77fe5d40a8..5ed63234093 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4173,7 +4173,8 @@ handle_face_prop_general (struct it *it, int initial_face_id,
4173 &next_stop, 4173 &next_stop,
4174 (IT_CHARPOS (*it) 4174 (IT_CHARPOS (*it)
4175 + TEXT_PROP_DISTANCE_LIMIT), 4175 + TEXT_PROP_DISTANCE_LIMIT),
4176 false, it->base_face_id, attr_filter); 4176 false, it->base_face_id,
4177 attr_filter);
4177 } 4178 }
4178 else 4179 else
4179 { 4180 {
@@ -4218,7 +4219,7 @@ handle_face_prop_general (struct it *it, int initial_face_id,
4218 (IT_CHARPOS (*it) 4219 (IT_CHARPOS (*it)
4219 + TEXT_PROP_DISTANCE_LIMIT), 4220 + TEXT_PROP_DISTANCE_LIMIT),
4220 false, 4221 false,
4221 from_overlay); 4222 from_overlay);
4222 } 4223 }
4223 else 4224 else
4224 { 4225 {
@@ -4252,7 +4253,8 @@ handle_face_prop_general (struct it *it, int initial_face_id,
4252 IT_STRING_CHARPOS (*it), 4253 IT_STRING_CHARPOS (*it),
4253 bufpos, 4254 bufpos,
4254 &next_stop, 4255 &next_stop,
4255 base_face_id, false); 4256 base_face_id, false,
4257 attr_filter);
4256 } /* !is_string. */ 4258 } /* !is_string. */
4257 4259
4258 /* Is this a start of a run of characters with box face? 4260 /* 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)
4422 base_face_id = underlying_face_id (it); 4424 base_face_id = underlying_face_id (it);
4423 4425
4424 /* Get the face for ASCII, or unibyte. */ 4426 /* Get the face for ASCII, or unibyte. */
4425 face_id = face_at_string_position (it->w, 4427 face_id = face_at_string_position (it->w, it->string, charpos,
4426 it->string, 4428 bufpos, &next_check_charpos,
4427 charpos, 4429 base_face_id, false, 0);
4428 bufpos,
4429 &next_check_charpos,
4430 base_face_id, false);
4431 4430
4432 /* Correct the face for charsets different from ASCII. Do it 4431 /* Correct the face for charsets different from ASCII. Do it
4433 for the multibyte case only. The face returned above is 4432 for the multibyte case only. The face returned above is
@@ -7637,7 +7636,8 @@ get_next_display_element (struct it *it)
7637 next_face_id 7636 next_face_id
7638 = face_at_string_position (it->w, base_string, 7637 = face_at_string_position (it->w, base_string,
7639 CHARPOS (pos), 0, 7638 CHARPOS (pos), 0,
7640 &ignore, face_id, false); 7639 &ignore, face_id,
7640 false, 0);
7641 it->end_of_box_run_p 7641 it->end_of_box_run_p
7642 = (FACE_FROM_ID (it->f, next_face_id)->box 7642 = (FACE_FROM_ID (it->f, next_face_id)->box
7643 == FACE_NO_BOX); 7643 == FACE_NO_BOX);
@@ -26569,8 +26569,8 @@ display_string (const char *string, Lisp_Object lisp_string, Lisp_Object face_st
26569 26569
26570 /* Initialize the iterator IT for iteration over STRING beginning 26570 /* Initialize the iterator IT for iteration over STRING beginning
26571 with index START. */ 26571 with index START. */
26572 reseat_to_string (it, NILP (lisp_string) ? string : NULL, lisp_string, start, 26572 reseat_to_string (it, NILP (lisp_string) ? string : NULL, lisp_string,
26573 precision, field_width, multibyte); 26573 start, precision, field_width, multibyte);
26574 if (string && STRINGP (lisp_string)) 26574 if (string && STRINGP (lisp_string))
26575 /* LISP_STRING is the one returned by decode_mode_spec. We should 26575 /* LISP_STRING is the one returned by decode_mode_spec. We should
26576 ignore its text properties. */ 26576 ignore its text properties. */
@@ -26585,7 +26585,7 @@ display_string (const char *string, Lisp_Object lisp_string, Lisp_Object face_st
26585 26585
26586 it->face_id 26586 it->face_id
26587 = face_at_string_position (it->w, face_string, face_string_pos, 26587 = face_at_string_position (it->w, face_string, face_string_pos,
26588 0, &endptr, it->base_face_id, false); 26588 0, &endptr, it->base_face_id, false, 0);
26589 face = FACE_FROM_ID (it->f, it->face_id); 26589 face = FACE_FROM_ID (it->f, it->face_id);
26590 it->face_box_p = face->box != FACE_NO_BOX; 26590 it->face_box_p = face->box != FACE_NO_BOX;
26591 } 26591 }
@@ -32745,11 +32745,10 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
32745 hlinfo->mouse_face_past_end = false; 32745 hlinfo->mouse_face_past_end = false;
32746 hlinfo->mouse_face_window = window; 32746 hlinfo->mouse_face_window = window;
32747 32747
32748 hlinfo->mouse_face_face_id = face_at_string_position (w, string, 32748 hlinfo->mouse_face_face_id =
32749 charpos, 32749 face_at_string_position (w, string, charpos, 0, &ignore,
32750 0, &ignore, 32750 glyph->face_id, true, 0);
32751 glyph->face_id, 32751
32752 true);
32753 show_mouse_face (hlinfo, DRAW_MOUSE_FACE); 32752 show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
32754 mouse_face_shown = true; 32753 mouse_face_shown = true;
32755 32754
@@ -33175,7 +33174,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
33175 hlinfo->mouse_face_window = window; 33174 hlinfo->mouse_face_window = window;
33176 hlinfo->mouse_face_face_id 33175 hlinfo->mouse_face_face_id
33177 = face_at_string_position (w, object, pos, 0, &ignore, 33176 = face_at_string_position (w, object, pos, 0, &ignore,
33178 glyph->face_id, true); 33177 glyph->face_id, true, 0);
33179 show_mouse_face (hlinfo, DRAW_MOUSE_FACE); 33178 show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
33180 cursor = No_Cursor; 33179 cursor = No_Cursor;
33181 } 33180 }
diff --git a/src/xfaces.c b/src/xfaces.c
index d3851d03342..082019d74e6 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -6275,9 +6275,10 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos,
6275 6275
6276int 6276int
6277face_at_string_position (struct window *w, Lisp_Object string, 6277face_at_string_position (struct window *w, Lisp_Object string,
6278 ptrdiff_t pos, ptrdiff_t bufpos, 6278 ptrdiff_t pos, ptrdiff_t bufpos,
6279 ptrdiff_t *endptr, enum face_id base_face_id, 6279 ptrdiff_t *endptr, enum face_id base_face_id,
6280 bool mouse_p) 6280 bool mouse_p,
6281 enum lface_attribute_index attr_filter)
6281{ 6282{
6282 Lisp_Object prop, position, end, limit; 6283 Lisp_Object prop, position, end, limit;
6283 struct frame *f = XFRAME (WINDOW_FRAME (w)); 6284 struct frame *f = XFRAME (WINDOW_FRAME (w));
@@ -6321,7 +6322,7 @@ face_at_string_position (struct window *w, Lisp_Object string,
6321 6322
6322 /* Merge in attributes specified via text properties. */ 6323 /* Merge in attributes specified via text properties. */
6323 if (!NILP (prop)) 6324 if (!NILP (prop))
6324 merge_face_ref (w, f, prop, attrs, true, NULL, 0); 6325 merge_face_ref (w, f, prop, attrs, true, NULL, attr_filter);
6325 6326
6326 /* Look up a realized face with the given face attributes, 6327 /* Look up a realized face with the given face attributes,
6327 or realize a new one for ASCII characters. */ 6328 or realize a new one for ASCII characters. */