[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/extend_face_id 46e8f70 10/14: Extend_face simplify
From: |
Jimmy Aguilar Mena |
Subject: |
[Emacs-diffs] scratch/extend_face_id 46e8f70 10/14: Extend_face simplify. |
Date: |
Sun, 29 Sep 2019 15:49:26 -0400 (EDT) |
branch: scratch/extend_face_id
commit 46e8f703511803bd395aa6d92ce5832d756a350a
Author: Jimmy Aguilar Mena <address@hidden>
Commit: Jimmy Aguilar Mena <address@hidden>
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.
---
src/dispextern.h | 7 ++-----
src/xdisp.c | 23 +++++++++++------------
2 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/src/dispextern.h b/src/dispextern.h
index 7e0da64..727d550 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2326,7 +2326,7 @@ struct it
/* 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
been delivered. */
- int saved_face_id, saved_extend_face_id;
+ int saved_face_id;
/* Vector of glyphs for control character translation. The pointer
dpvec is set to ctl_chars when a control character is translated.
@@ -2388,7 +2388,7 @@ struct it
ptrdiff_t prev_stop;
ptrdiff_t base_level_stop;
struct composition_it cmp_it;
- int face_id, extend_face_id;
+ int face_id;
/* Save values specific to a given method. */
union {
@@ -2446,9 +2446,6 @@ struct it
/* Face to use. */
int face_id;
- /* Face to extend at EOL/ */
- int extend_face_id;
-
/* Setting of buffer-local variable selective-display-ellipses. */
bool_bf selective_display_ellipsis_p : 1;
diff --git a/src/xdisp.c b/src/xdisp.c
index 2a9024d..43b2bad 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4115,8 +4115,7 @@ handle_fontified_prop (struct it *it)
***********************************************************************/
static int
-handle_face_prop_general (struct it *it, int initial_face_id,
- enum lface_attribute_index attr_filter)
+face_at_pos (struct it *it, enum lface_attribute_index attr_filter)
{
int new_face_id;
ptrdiff_t next_stop;
@@ -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
box, all characters up to limit will have one. But, as
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);
/* If it->face_id is -1, old_face below will be NULL, see
the definition of FACE_FROM_ID_OR_NULL. This will happen
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
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,
static enum prop_handled
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;
}
@@ -20492,15 +20491,15 @@ extend_face_to_end_of_line (struct it *it)
|| WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0))
return;
- it->extend_face_id
- = handle_face_prop_general (it, it->extend_face_id, LFACE_EXTEND_INDEX);
+ const int extend_face_id
+ = face_at_pos (it, LFACE_EXTEND_INDEX);
/* Face extension extends the background and box of IT->extend_face_id
to the end of the line. If the background equals the background
of the frame, we don't have to do anything. */
face = FACE_FROM_ID (f, (it->face_before_selective_p
- ? it->saved_face_id
- : it->extend_face_id));
+ ? it->saved_face_id
+ : extend_face_id));
if (FRAME_WINDOW_P (f)
&& MATRIX_ROW_DISPLAYS_TEXT_P (it->glyph_row)
@@ -20591,7 +20590,7 @@ extend_face_to_end_of_line (struct it *it)
Lisp_Object save_object = it->object;
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->object = Qnil;
@@ -20625,7 +20624,7 @@ extend_face_to_end_of_line (struct it *it)
= XFIXNAT (Vdisplay_fill_column_indicator_character);
it->face_id
= merge_faces (it->w, Qfill_column_indicator,
- 0, it->extend_face_id);
+ 0, extend_face_id);
PRODUCE_GLYPHS (it);
it->face_id = save_face_id;
}
@@ -20772,7 +20771,7 @@ extend_face_to_end_of_line (struct it *it)
{
int saved_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
= XFIXNAT (Vdisplay_fill_column_indicator_character);
- [Emacs-diffs] branch scratch/extend_face_id created (now c7c7fae), Jimmy Aguilar Mena, 2019/09/29
- [Emacs-diffs] scratch/extend_face_id c1dbe02 04/14: Fixed extend face filtered for prop., Jimmy Aguilar Mena, 2019/09/29
- [Emacs-diffs] scratch/extend_face_id 523aeb6 01/14: Simplify struct face to use only underline., Jimmy Aguilar Mena, 2019/09/29
- [Emacs-diffs] scratch/extend_face_id 6a3808c 02/14: Added face parameter :extend., Jimmy Aguilar Mena, 2019/09/29
- [Emacs-diffs] scratch/extend_face_id 4859ca2 08/14: Make hl-line face to extend all the line.., Jimmy Aguilar Mena, 2019/09/29
- [Emacs-diffs] scratch/extend_face_id 46e8f70 10/14: Extend_face simplify.,
Jimmy Aguilar Mena <=
- [Emacs-diffs] scratch/extend_face_id 28655de 03/14: Conditional merged face to extend after eol., Jimmy Aguilar Mena, 2019/09/29
- [Emacs-diffs] scratch/extend_face_id 30fe702 06/14: Add space for cursor to work also in terminal., Jimmy Aguilar Mena, 2019/09/29
- [Emacs-diffs] scratch/extend_face_id 34b31fe 05/14: Changed handle_face_prop_general prototype., Jimmy Aguilar Mena, 2019/09/29
- [Emacs-diffs] scratch/extend_face_id 21fdd67 07/14: Fix last change in append_space_for_newline., Jimmy Aguilar Mena, 2019/09/29
- [Emacs-diffs] scratch/extend_face_id 76da65a 09/14: Added parameter attr_filter to face_at_string_position., Jimmy Aguilar Mena, 2019/09/29
- [Emacs-diffs] scratch/extend_face_id c7c7fae 14/14: * etc/NEWS : Added comment about :extend face attribute in NEWS., Jimmy Aguilar Mena, 2019/09/29
- [Emacs-diffs] scratch/extend_face_id be3b66e 13/14: Document new :extend face attribute in manuals., Jimmy Aguilar Mena, 2019/09/29
- [Emacs-diffs] scratch/extend_face_id 06d35c2 12/14: Fixed merge_face_ref recursive calls., Jimmy Aguilar Mena, 2019/09/29
- [Emacs-diffs] scratch/extend_face_id 1fe9bee 11/14: Optimization in extend_face, Jimmy Aguilar Mena, 2019/09/29