Commit 46e8f703 authored by Jimmy Aguilar Mena's avatar Jimmy Aguilar Mena

Extend_face simplify.

* src/dispextern.h (struct it) : Removed extend_face unneeded members.
* src/xdisp.c (handle_face_prop_general) : renamed to face_at_pos and
removed input parameter initial_face_id. Updated all occurrences.
parent 76da65a9
...@@ -2326,7 +2326,7 @@ struct it ...@@ -2326,7 +2326,7 @@ struct it
/* Face id of the iterator saved in case a glyph from dpvec contains /* Face id of the iterator saved in case a glyph from dpvec contains
a face. The face is restored when all glyphs from dpvec have a face. The face is restored when all glyphs from dpvec have
been delivered. */ been delivered. */
int saved_face_id, saved_extend_face_id; int saved_face_id;
/* Vector of glyphs for control character translation. The pointer /* Vector of glyphs for control character translation. The pointer
dpvec is set to ctl_chars when a control character is translated. dpvec is set to ctl_chars when a control character is translated.
...@@ -2388,7 +2388,7 @@ struct it ...@@ -2388,7 +2388,7 @@ struct it
ptrdiff_t prev_stop; ptrdiff_t prev_stop;
ptrdiff_t base_level_stop; ptrdiff_t base_level_stop;
struct composition_it cmp_it; struct composition_it cmp_it;
int face_id, extend_face_id; int face_id;
/* Save values specific to a given method. */ /* Save values specific to a given method. */
union { union {
...@@ -2446,9 +2446,6 @@ struct it ...@@ -2446,9 +2446,6 @@ struct it
/* Face to use. */ /* Face to use. */
int face_id; int face_id;
/* Face to extend at EOL/ */
int extend_face_id;
/* Setting of buffer-local variable selective-display-ellipses. */ /* Setting of buffer-local variable selective-display-ellipses. */
bool_bf selective_display_ellipsis_p : 1; bool_bf selective_display_ellipsis_p : 1;
......
...@@ -4115,8 +4115,7 @@ handle_fontified_prop (struct it *it) ...@@ -4115,8 +4115,7 @@ handle_fontified_prop (struct it *it)
***********************************************************************/ ***********************************************************************/
static int static int
handle_face_prop_general (struct it *it, int initial_face_id, face_at_pos (struct it *it, enum lface_attribute_index attr_filter)
enum lface_attribute_index attr_filter)
{ {
int new_face_id; int new_face_id;
ptrdiff_t next_stop; ptrdiff_t next_stop;
...@@ -4220,13 +4219,13 @@ handle_face_prop_general (struct it *it, int initial_face_id, ...@@ -4220,13 +4219,13 @@ handle_face_prop_general (struct it *it, int initial_face_id,
face will not change until limit, i.e. if the new face has a face will not change until limit, i.e. if the new face has a
box, all characters up to limit will have one. But, as box, all characters up to limit will have one. But, as
usual, we don't know whether limit is really the end. */ usual, we don't know whether limit is really the end. */
if (new_face_id != initial_face_id) if (new_face_id != it->face_id)
{ {
struct face *new_face = FACE_FROM_ID (it->f, new_face_id); struct face *new_face = FACE_FROM_ID (it->f, new_face_id);
/* If it->face_id is -1, old_face below will be NULL, see /* If it->face_id is -1, old_face below will be NULL, see
the definition of FACE_FROM_ID_OR_NULL. This will happen the definition of FACE_FROM_ID_OR_NULL. This will happen
if this is the initial call that gets the face. */ if this is the initial call that gets the face. */
struct face *old_face = FACE_FROM_ID_OR_NULL (it->f, initial_face_id); struct face *old_face = FACE_FROM_ID_OR_NULL (it->f, it->face_id);
/* If the value of face_id of the iterator is -1, we have to /* If the value of face_id of the iterator is -1, we have to
look in front of IT's position and see whether there is a look in front of IT's position and see whether there is a
...@@ -4257,7 +4256,7 @@ handle_face_prop_general (struct it *it, int initial_face_id, ...@@ -4257,7 +4256,7 @@ handle_face_prop_general (struct it *it, int initial_face_id,
static enum prop_handled static enum prop_handled
handle_face_prop (struct it *it) handle_face_prop (struct it *it)
{ {
it->face_id = handle_face_prop_general (it, it->face_id, 0); it->face_id = face_at_pos (it, 0);
return HANDLED_NORMALLY; return HANDLED_NORMALLY;
} }
...@@ -20492,15 +20491,15 @@ extend_face_to_end_of_line (struct it *it) ...@@ -20492,15 +20491,15 @@ extend_face_to_end_of_line (struct it *it)
|| WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0)) || WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0))
return; return;
it->extend_face_id const int extend_face_id
= handle_face_prop_general (it, it->extend_face_id, LFACE_EXTEND_INDEX); = face_at_pos (it, LFACE_EXTEND_INDEX);
/* Face extension extends the background and box of IT->extend_face_id /* Face extension extends the background and box of IT->extend_face_id
to the end of the line. If the background equals the background to the end of the line. If the background equals the background
of the frame, we don't have to do anything. */ of the frame, we don't have to do anything. */
face = FACE_FROM_ID (f, (it->face_before_selective_p face = FACE_FROM_ID (f, (it->face_before_selective_p
? it->saved_face_id ? it->saved_face_id
: it->extend_face_id)); : extend_face_id));
if (FRAME_WINDOW_P (f) if (FRAME_WINDOW_P (f)
&& MATRIX_ROW_DISPLAYS_TEXT_P (it->glyph_row) && MATRIX_ROW_DISPLAYS_TEXT_P (it->glyph_row)
...@@ -20591,7 +20590,7 @@ extend_face_to_end_of_line (struct it *it) ...@@ -20591,7 +20590,7 @@ extend_face_to_end_of_line (struct it *it)
Lisp_Object save_object = it->object; Lisp_Object save_object = it->object;
const int saved_face_id = it->face_id; const int saved_face_id = it->face_id;
it->face_id = it->extend_face_id; it->face_id = extend_face_id;
it->avoid_cursor_p = true; it->avoid_cursor_p = true;
it->object = Qnil; it->object = Qnil;
...@@ -20625,7 +20624,7 @@ extend_face_to_end_of_line (struct it *it) ...@@ -20625,7 +20624,7 @@ extend_face_to_end_of_line (struct it *it)
= XFIXNAT (Vdisplay_fill_column_indicator_character); = XFIXNAT (Vdisplay_fill_column_indicator_character);
it->face_id it->face_id
= merge_faces (it->w, Qfill_column_indicator, = merge_faces (it->w, Qfill_column_indicator,
0, it->extend_face_id); 0, extend_face_id);
PRODUCE_GLYPHS (it); PRODUCE_GLYPHS (it);
it->face_id = save_face_id; it->face_id = save_face_id;
} }
...@@ -20772,7 +20771,7 @@ extend_face_to_end_of_line (struct it *it) ...@@ -20772,7 +20771,7 @@ extend_face_to_end_of_line (struct it *it)
{ {
int saved_face_id = it->face_id; int saved_face_id = it->face_id;
it->face_id it->face_id
= merge_faces (it->w, Qfill_column_indicator, 0, it->extend_face_id); = merge_faces (it->w, Qfill_column_indicator, 0, extend_face_id);
it->c = it->char_to_display it->c = it->char_to_display
= XFIXNAT (Vdisplay_fill_column_indicator_character); = XFIXNAT (Vdisplay_fill_column_indicator_character);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment