bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width


From: Titus von der Malsburg
Subject: bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width
Date: Tue, 16 Dec 2014 19:28:45 -0800

On 2014-12-16 Tue 12:58, Eli Zaretskii wrote:
>> From: Titus von der Malsburg <malsburg@posteo.de>
>> Cc: 19395@debbugs.gnu.org
>> Date: Tue, 16 Dec 2014 12:36:13 -0800
>> 
>> > The n+1st character is usurped for the continuation glyph.  This is
>> > not a bug.
>> 
>> Sorry, but I don't understand that.  If (window-width) says there is
>> space for 50 characters and I put 50 characters on a line, there
>> shouldn't be a continuation character in the first place.
>
> window-width doesn't report the number of characters a window's line
> can hold without continuation.  It reports the window width in
> character units.  When there's no fringe to display the continuation
> bitmap, that width includes the space reserved for the continuation
> glyph, which is the backslash character produced by the display engine
> on the last column of the line.
>
>> Also, I don't see why I should get different behaviour for different
>> values of left-fringe.  When left-fringe is > 0, I get as many
>> characters on a line as (window-width) reports.  But if left-fringe
>> is 0, I get one character less on the line.
>
> As long as the left fringe exists, we can display on it.  But once its
> width is zero, it no longer exists, and so we need to reserve space to
> display the continuation glyph "by other means".

I see, thanks for explaining.  Perhaps it would make sense to amend the
documentation of `window-width' because this is easy to misunderstand
and I suspect that I'm not the only one who consults window-width in
order to determine how much columns are available for text display.  In
term.el, I found a function that does what I want (`term-window-width')
but requiring term.el only to use this function seems
inappropriate.  Duplicating this function is not perfect either.

  Titus

>> This behaviour doesn't seem to be consistent with the documentation
>> of window-width.  Quote:
>> 
>>   The return value does not include any vertical dividers, fringes or
>>   marginal areas, or scroll bars.
>
> This doesn't say anything about continuation and truncation glyphs, so
> I see no inconsistency here, perhaps just missing details.
>
>> My understanding of this is that the fringes should not matter at
>> all.  If window-with reports n, I should be able to fit n characters on
>> a line irrespective of what the fringes are.
>
> I tried to explain above why this interpretation is incorrect:
> window-width does not return the number of characters of buffer text
> that can be displayed on a line.
>
>> Moreover, why is this specific to the left-fringe?  The value of
>> right-fringe does not affect influence whether I can get
>> (window-width) or (window-width) -1 characters on a line.
>
> That's not what I see here.  Setting any of the fringes' width to zero
> causes window-width to report 1 more character than you can put on a
> line without going to a continuation line.  IOW, the "penalty" is
> symmetrical, at least on my machine.






reply via email to

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