[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/extend_face_id fe14633 10/14: Extend_face simplify
From: |
Jimmy Aguilar Mena |
Subject: |
[Emacs-diffs] feature/extend_face_id fe14633 10/14: Extend_face simplify. |
Date: |
Wed, 2 Oct 2019 18:01:40 -0400 (EDT) |
branch: feature/extend_face_id
commit fe1463357505442e4334c7af9b6b1a2df786930a
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 ee312c0..e6db160 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2374,7 +2374,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.
@@ -2436,7 +2436,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 {
@@ -2494,9 +2494,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 d8976e2..2685a2e 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4158,8 +4158,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;
@@ -4263,13 +4262,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
@@ -4300,7 +4299,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;
}
@@ -21481,15 +21480,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)
@@ -21582,7 +21581,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;
@@ -21616,7 +21615,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;
}
@@ -21763,7 +21762,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] feature/extend_face_id f6d3055 08/14: Make hl-line face to extend all the line.., (continued)
- [Emacs-diffs] feature/extend_face_id f6d3055 08/14: Make hl-line face to extend all the line.., Jimmy Aguilar Mena, 2019/10/02
- [Emacs-diffs] feature/extend_face_id b795eca 07/14: Fix last change in append_space_for_newline., Jimmy Aguilar Mena, 2019/10/02
- [Emacs-diffs] feature/extend_face_id b268830 04/14: Fixed extend face filtered for prop., Jimmy Aguilar Mena, 2019/10/02
- [Emacs-diffs] feature/extend_face_id da942db 05/14: Changed handle_face_prop_general prototype., Jimmy Aguilar Mena, 2019/10/02
- [Emacs-diffs] feature/extend_face_id 825a5eb 03/14: Conditional merged face to extend after eol., Jimmy Aguilar Mena, 2019/10/02
- [Emacs-diffs] feature/extend_face_id e09586a 09/14: Added parameter attr_filter to face_at_string_position., Jimmy Aguilar Mena, 2019/10/02
- [Emacs-diffs] feature/extend_face_id d3ffc4c 12/14: Fixed merge_face_ref recursive calls., Jimmy Aguilar Mena, 2019/10/02
- [Emacs-diffs] feature/extend_face_id aa0a14d 06/14: Add space for cursor to work also in terminal., Jimmy Aguilar Mena, 2019/10/02
- [Emacs-diffs] feature/extend_face_id 29f8728 11/14: Optimization in extend_face, Jimmy Aguilar Mena, 2019/10/02
- [Emacs-diffs] feature/extend_face_id 98278db 13/14: Document new :extend face attribute in manuals., Jimmy Aguilar Mena, 2019/10/02
- [Emacs-diffs] feature/extend_face_id fe14633 10/14: Extend_face simplify.,
Jimmy Aguilar Mena <=
- [Emacs-diffs] feature/extend_face_id 567b53c 14/14: * etc/NEWS : Added comment about :extend face attribute in NEWS., Jimmy Aguilar Mena, 2019/10/02