[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/extend_face_id 834e23f 09/15: Added parameter attr
From: |
Jimmy Aguilar Mena |
Subject: |
[Emacs-diffs] feature/extend_face_id 834e23f 09/15: Added parameter attr_filter to face_at_string_position. |
Date: |
Wed, 9 Oct 2019 10:53:12 -0400 (EDT) |
branch: feature/extend_face_id
commit 834e23ffe9082769e1c86f2389453ced1c92024b
Author: Jimmy Aguilar Mena <address@hidden>
Commit: Jimmy Aguilar Mena <address@hidden>
Added parameter attr_filter to face_at_string_position.
Update all the occurrences in src/xdisp.c and src/xfaces.c
---
src/dispextern.h | 3 ++-
src/font.c | 4 ++--
src/xdisp.c | 37 ++++++++++++++++++-------------------
src/xfaces.c | 9 +++++----
4 files changed, 27 insertions(+), 26 deletions(-)
diff --git a/src/dispextern.h b/src/dispextern.h
index 5db3ae8..8bbabbe 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -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,
bool, Lisp_Object);
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 compute_char_face (struct frame *, int, Lisp_Object);
void free_all_realized_faces (Lisp_Object);
diff --git a/src/font.c b/src/font.c
index e1e33ab..7fdadb1 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,
if (STRINGP (string))
face_id = face_at_string_position (w, string, pos, 0, &endptr,
- DEFAULT_FACE_ID, 0);
+ DEFAULT_FACE_ID, false, 0);
else
face_id = face_at_buffer_position (w, pos, &endptr,
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);
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);
}
diff --git a/src/xdisp.c b/src/xdisp.c
index e59a5a4..53714bf 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4173,7 +4173,8 @@ handle_face_prop_general (struct it *it, int
initial_face_id,
&next_stop,
(IT_CHARPOS (*it)
+ TEXT_PROP_DISTANCE_LIMIT),
- false, it->base_face_id, attr_filter);
+ false, it->base_face_id,
+ attr_filter);
}
else
{
@@ -4218,7 +4219,7 @@ handle_face_prop_general (struct it *it, int
initial_face_id,
(IT_CHARPOS (*it)
+ TEXT_PROP_DISTANCE_LIMIT),
false,
- from_overlay);
+ from_overlay);
}
else
{
@@ -4252,7 +4253,8 @@ handle_face_prop_general (struct it *it, int
initial_face_id,
IT_STRING_CHARPOS (*it),
bufpos,
&next_stop,
- base_face_id, false);
+ base_face_id, false,
+ attr_filter);
} /* !is_string. */
/* 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);
/* Get the face for ASCII, or unibyte. */
- face_id = face_at_string_position (it->w,
- it->string,
- charpos,
- bufpos,
- &next_check_charpos,
- base_face_id, false);
+ face_id = face_at_string_position (it->w, it->string, charpos,
+ bufpos, &next_check_charpos,
+ base_face_id, false, 0);
/* Correct the face for charsets different from ASCII. Do it
for the multibyte case only. The face returned above is
@@ -7637,7 +7636,8 @@ get_next_display_element (struct it *it)
next_face_id
= face_at_string_position (it->w, base_string,
CHARPOS (pos), 0,
- &ignore, face_id, false);
+ &ignore, face_id,
+ false, 0);
it->end_of_box_run_p
= (FACE_FROM_ID (it->f, next_face_id)->box
== FACE_NO_BOX);
@@ -26572,8 +26572,8 @@ display_string (const char *string, Lisp_Object
lisp_string, Lisp_Object face_st
/* Initialize the iterator IT for iteration over STRING beginning
with index START. */
- reseat_to_string (it, NILP (lisp_string) ? string : NULL, lisp_string, start,
- precision, field_width, multibyte);
+ reseat_to_string (it, NILP (lisp_string) ? string : NULL, lisp_string,
+ start, precision, field_width, multibyte);
if (string && STRINGP (lisp_string))
/* LISP_STRING is the one returned by decode_mode_spec. We should
ignore its text properties. */
@@ -26588,7 +26588,7 @@ display_string (const char *string, Lisp_Object
lisp_string, Lisp_Object face_st
it->face_id
= 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);
it->face_box_p = face->box != FACE_NO_BOX;
}
@@ -32748,11 +32748,10 @@ note_mode_line_or_margin_highlight (Lisp_Object
window, int x, int y,
hlinfo->mouse_face_past_end = false;
hlinfo->mouse_face_window = window;
- hlinfo->mouse_face_face_id = face_at_string_position (w, string,
- charpos,
- 0, &ignore,
- glyph->face_id,
- true);
+ hlinfo->mouse_face_face_id =
+ face_at_string_position (w, string, charpos, 0, &ignore,
+ glyph->face_id, true, 0);
+
show_mouse_face (hlinfo, DRAW_MOUSE_FACE);
mouse_face_shown = true;
@@ -33178,7 +33177,7 @@ note_mouse_highlight (struct frame *f, int x, int y)
hlinfo->mouse_face_window = window;
hlinfo->mouse_face_face_id
= 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);
cursor = No_Cursor;
}
diff --git a/src/xfaces.c b/src/xfaces.c
index d3851d0..082019d 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -6275,9 +6275,10 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos,
int
face_at_string_position (struct window *w, Lisp_Object string,
- ptrdiff_t pos, ptrdiff_t bufpos,
- ptrdiff_t *endptr, enum face_id base_face_id,
- bool mouse_p)
+ ptrdiff_t pos, ptrdiff_t bufpos,
+ ptrdiff_t *endptr, enum face_id base_face_id,
+ bool mouse_p,
+ enum lface_attribute_index attr_filter)
{
Lisp_Object prop, position, end, limit;
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. */
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,
or realize a new one for ASCII characters. */
- [Emacs-diffs] feature/extend_face_id 92e9f9d 02/15: Added face parameter :extend., (continued)
- [Emacs-diffs] feature/extend_face_id 92e9f9d 02/15: Added face parameter :extend., Jimmy Aguilar Mena, 2019/10/09
- [Emacs-diffs] feature/extend_face_id e4761a2 07/15: Fix last change in append_space_for_newline., Jimmy Aguilar Mena, 2019/10/09
- [Emacs-diffs] feature/extend_face_id bc9905a 11/15: Optimization in extend_face, Jimmy Aguilar Mena, 2019/10/09
- [Emacs-diffs] feature/extend_face_id 9750a03 12/15: Fixed merge_face_ref recursive calls., Jimmy Aguilar Mena, 2019/10/09
- [Emacs-diffs] feature/extend_face_id 111dcf8 01/15: Simplify struct face to use only underline., Jimmy Aguilar Mena, 2019/10/09
- [Emacs-diffs] feature/extend_face_id d8cb394 08/15: Make hl-line face to extend all the line.., Jimmy Aguilar Mena, 2019/10/09
- [Emacs-diffs] feature/extend_face_id 41d6d91 04/15: Fixed extend face filtered for prop., Jimmy Aguilar Mena, 2019/10/09
- [Emacs-diffs] feature/extend_face_id d5ded9d 03/15: Conditional merged face to extend after eol., Jimmy Aguilar Mena, 2019/10/09
- [Emacs-diffs] feature/extend_face_id 567644e 06/15: Add space for cursor to work also in terminal., Jimmy Aguilar Mena, 2019/10/09
- [Emacs-diffs] feature/extend_face_id 9fa74c4 05/15: Changed handle_face_prop_general prototype., Jimmy Aguilar Mena, 2019/10/09
- [Emacs-diffs] feature/extend_face_id 834e23f 09/15: Added parameter attr_filter to face_at_string_position.,
Jimmy Aguilar Mena <=
- [Emacs-diffs] feature/extend_face_id ae9787b 10/15: Extend_face simplify., Jimmy Aguilar Mena, 2019/10/09
- [Emacs-diffs] feature/extend_face_id 19801c2 14/15: * etc/NEWS : Added comment about :extend face attribute in NEWS., Jimmy Aguilar Mena, 2019/10/09
- [Emacs-diffs] feature/extend_face_id 6b50c01 13/15: Document new :extend face attribute in manuals., Jimmy Aguilar Mena, 2019/10/09
- [Emacs-diffs] feature/extend_face_id 0a7b2b0 15/15: ; extend_face_id and fill_column_indicator corrections, Jimmy Aguilar Mena, 2019/10/09