[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Merging the underline attribute at EOL

From: Ergus
Subject: Re: Merging the underline attribute at EOL
Date: Thu, 19 Dec 2019 02:19:10 +0100

On Tue, Dec 17, 2019 at 07:18:23PM +0200, Eli Zaretskii wrote:
Date: Tue, 17 Dec 2019 15:13:45 +0100
From: Ergus <address@hidden>
Cc: address@hidden

--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -21596,13 +21596,17 @@ extend_face_to_end_of_line (struct it *it)

   if (FRAME_WINDOW_P (f)
       && MATRIX_ROW_DISPLAYS_TEXT_P (it->glyph_row)
-      && face->box == FACE_NO_BOX
       && FACE_COLOR_TO_PIXEL (face->background, f) == FRAME_BACKGROUND_PIXEL 
       && !face->stipple
       && !it->glyph_row->reversed_p
-      && !Vdisplay_fill_column_indicator)
+      && !Vdisplay_fill_column_indicator
+      && (NILP (face->lface[LFACE_EXTEND_INDEX])
+          ||(face->box == FACE_NO_BOX
+            && face->underline == FACE_NO_UNDERLINE
+            && face->overline_p == false
+            && face->strike_through_p == false)))

I don't think I understand the test for the :extend attribute being
non-nil.  Can you explain why you added it?  In general, faces that we
treat as "base face" when we start face merging don't need to have the
:extend attribute set (see, for example, the tool-bar face), but we
still want to apply them to the space past EOL.  Am I missing
something?  Did you bump into some scenario where this attribute
caused some regression or bad results?


Hi Eli:

I just added that test (probably not the best one) for the case where
the face is the default face. Actually the merge we use (with the
filter) asserts that the resulting face will be :extend t or the default
face (AFAIR).

So at this point I thought (probably wrong) that only the default face
could have :extend nil and we could exit early in that case... But if
there are some cases that I am not considering we can remove that.

Do you think that removing it, the rest of the changes will be enough?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]