From a8a13cec225b00117557e5c84999a877843099da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pit-Claudel?= Date: Mon, 11 May 2020 16:52:51 -0400 Subject: [PATCH] Add a margin face, remove short-circuits in extend_face_to_end_of_line --- src/dispextern.h | 1 + src/xdisp.c | 10 ++++++---- src/xfaces.c | 3 +++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/dispextern.h b/src/dispextern.h index 0b1f3d14ae..2650d49e02 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1814,6 +1814,7 @@ #define FACE_UNIBYTE_P(FACE) ((FACE)->charset < 0) MODE_LINE_INACTIVE_FACE_ID, TOOL_BAR_FACE_ID, FRINGE_FACE_ID, + MARGIN_FACE_ID, HEADER_LINE_FACE_ID, SCROLL_BAR_FACE_ID, BORDER_FACE_ID, diff --git a/src/xdisp.c b/src/xdisp.c index 140d134572..5a7bf58828 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -21759,7 +21759,8 @@ extend_face_to_end_of_line (struct it *it) /* If the window has display margins, we will need to extend their face even if the text area is filled. */ && !(WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0 - || WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0)) + || WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0) + && false) return; const int extend_face_id = (it->face_id == DEFAULT_FACE_ID @@ -21785,7 +21786,8 @@ extend_face_to_end_of_line (struct it *it) && !face->stipple #endif && !it->glyph_row->reversed_p - && !Vdisplay_fill_column_indicator) + && !Vdisplay_fill_column_indicator + && false) return; /* Set the glyph row flag indicating that the face of the last glyph @@ -21834,7 +21836,7 @@ extend_face_to_end_of_line (struct it *it) { it->glyph_row->glyphs[LEFT_MARGIN_AREA][0] = space_glyph; it->glyph_row->glyphs[LEFT_MARGIN_AREA][0].face_id = - default_face->id; + lookup_named_face (it->w, f, Qmargin, false); it->glyph_row->used[LEFT_MARGIN_AREA] = 1; } if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0 @@ -21842,7 +21844,7 @@ extend_face_to_end_of_line (struct it *it) { it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0] = space_glyph; it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0].face_id = - default_face->id; + lookup_named_face (it->w, f, Qmargin, false); it->glyph_row->used[RIGHT_MARGIN_AREA] = 1; } diff --git a/src/xfaces.c b/src/xfaces.c index bab142ade0..f604c43928 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -4768,6 +4768,7 @@ lookup_basic_face (struct window *w, struct frame *f, int face_id) case TAB_BAR_FACE_ID: name = Qtab_bar; break; case TOOL_BAR_FACE_ID: name = Qtool_bar; break; case FRINGE_FACE_ID: name = Qfringe; break; + case MARGIN_FACE_ID: name = Qmargin; break; case SCROLL_BAR_FACE_ID: name = Qscroll_bar; break; case BORDER_FACE_ID: name = Qborder; break; case CURSOR_FACE_ID: name = Qcursor; break; @@ -5463,6 +5464,7 @@ realize_basic_faces (struct frame *f) realize_named_face (f, Qmode_line_inactive, MODE_LINE_INACTIVE_FACE_ID); realize_named_face (f, Qtool_bar, TOOL_BAR_FACE_ID); realize_named_face (f, Qfringe, FRINGE_FACE_ID); + realize_named_face (f, Qmargin, MARGIN_FACE_ID); realize_named_face (f, Qheader_line, HEADER_LINE_FACE_ID); realize_named_face (f, Qscroll_bar, SCROLL_BAR_FACE_ID); realize_named_face (f, Qborder, BORDER_FACE_ID); @@ -6808,6 +6810,7 @@ syms_of_xfaces (void) DEFSYM (Qtool_bar, "tool-bar"); DEFSYM (Qtab_bar, "tab-bar"); DEFSYM (Qfringe, "fringe"); + DEFSYM (Qmargin, "margin"); DEFSYM (Qtab_line, "tab-line"); DEFSYM (Qheader_line, "header-line"); DEFSYM (Qscroll_bar, "scroll-bar"); -- 2.17.1