GNU bug report logs - #36858
27.0.50; display bugs with display-fill-column-indicator-mode

Previous Next

Package: emacs;

Reported by: Davor Rotim <rotim.davor <at> gmail.com>

Date: Tue, 30 Jul 2019 18:12:01 UTC

Severity: normal

Found in version 27.0.50

Done: Ergus <spacibba <at> aol.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ergus <spacibba <at> aol.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 36858 <at> debbugs.gnu.org, rotim.davor <at> gmail.com
Subject: bug#36858: 27.0.50; display bugs with display-fill-column-indicator-mode
Date: Wed, 7 Aug 2019 18:20:33 +0200
[Message part 1 (text/plain, inline)]
On Wed, Aug 07, 2019 at 05:38:30PM +0300, Eli Zaretskii wrote:
>> Date: Mon, 5 Aug 2019 17:27:47 +0200
>> From: Ergus <spacibba <at> aol.com>
>> Cc: 36858 <at> debbugs.gnu.org, Davor Rotim <rotim.davor <at> gmail.com>
>>
>> 1) The condition ends_at_zv_p didn't work as expected, I don't know If
>> this is an issue somewhere else, but at least in my tests, the condition
>> was always false. (for all the lines implied before and after ZV, where
>> there was company window or not)
>>
>> So the filter condition I am using now is:
>>
>> IT_CHARPOS (*it) < ZV
>>
>> which seems to work fine.
>>
>> 2) There is a corner case because the indicator is never generated for
>> the latest line in the buffer. So a \n is required always at the end of
>> the buffer if there is text, which for me is fine (unix format), but I
>> don't know if I should correct that, should I?
>
>Unix format has nothing to do with this, as in a buffer we always have
>only \n characters at end of line.  But notr having the indicator show
>in the last line of a buffer that doesn't end in a newline is
>unfortunate.  Which is why I suggested to test the ends_at_zv_p flag.
>What exactly didn't work with it?  Can you show me a test case where
>the glyph rows past ZV don't have this flag set?  Maybe you should
>test the enabled_p flag as well?
>
Hi Eli:

I just made this test:

in this code (in xdisp.c):

if (it->current_x < indicator_column_x)
 {
   it->face_id = merge_faces (it->w, Qextend_to_end_of_line,
                              0, extend_face_merged_id);

   it->char_to_display = XFIXNAT (Vdisplay_fill_column_indicator_character);
   PRODUCE_GLYPHS (it);

   it->face_id = extend_face_merged_id;
}

I changed char_to_display:

it->char_to_display = (it->glyph_row->ends_at_zv_p) ? '1' : '0';

And then I obtained the attached image.

As you can see the condition returns 0 for lines before zv, for the last
text line and for the company extra lines.

>> In terminal emacs, in the original emacs-26 code, in the function:
>> extend_face_to_end_of_line the code was:
>>
>> ```
>>  face = FACE_FROM_ID (f, (it->face_before_selective_p
>> 			   ? it->saved_face_id
>> 			   : it->face_id));
>>  (...)
>>
>>  if (it->glyph_row->ends_at_zv_p)
>>      it->face_id = default_face->id;
>>  else
>>      it->face_id = face->id;
>>  PRODUCE_GLYPHS (it);
>>
>>  while (it->current_x <= it->last_visible_x)
>>      PRODUCE_GLYPHS (it);
>> ```
>>
>> So the rest of the line was filled with the last face, (so this issue was
>> already there since then, because the rest of the line is filled with an
>> underlined face)
>>
>> I can change the code to fill the rest of the line with a new merged
>> face (as I do for graphical emacs), but I think that this fix is
>> unrelated with dfci, so maybe someone else must give a look before to
>> prevent me breaking anything.
>
>This is a more general issue, and I will respond to your question on
>emacs-devel.
>
>Thanks.
[Screenshot_2019-08-07_18-10-20.png (image/png, attachment)]

This bug report was last modified 5 years and 215 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.