unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Titus von der Malsburg <malsburg@posteo.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 19395@debbugs.gnu.org
Subject: bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width
Date: Tue, 16 Dec 2014 19:28:45 -0800	[thread overview]
Message-ID: <87bnn39cpe.fsf@posteo.de> (raw)
In-Reply-To: <83h9wvwbux.fsf@gnu.org>


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.






  parent reply	other threads:[~2014-12-17  3:28 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-16 20:01 bug#19395: 25.0.50; Setting left fringe to 0 messes up window-width Titus von der Malsburg
2014-12-16 20:09 ` Eli Zaretskii
2014-12-16 20:36   ` Titus von der Malsburg
2014-12-16 20:58     ` Eli Zaretskii
2014-12-16 23:12       ` Stefan Monnier
2014-12-17  3:39         ` Eli Zaretskii
2014-12-17 14:16           ` Stefan Monnier
2014-12-17 15:47             ` Eli Zaretskii
2014-12-17 21:31               ` Stefan Monnier
2014-12-17 22:57                 ` Drew Adams
2014-12-18  3:37                 ` Eli Zaretskii
2014-12-18 14:24                   ` Stefan Monnier
2014-12-18 15:51                     ` Eli Zaretskii
2014-12-20 10:09                       ` martin rudalics
2014-12-20 11:00                         ` Eli Zaretskii
2014-12-17  3:46         ` Titus von der Malsburg
2014-12-17 15:29           ` Eli Zaretskii
2014-12-17 21:34             ` Stefan Monnier
2014-12-18  3:40               ` Eli Zaretskii
2014-12-18 14:25                 ` Stefan Monnier
2014-12-18 15:52                   ` Eli Zaretskii
2014-12-17  3:28       ` Titus von der Malsburg [this message]
2014-12-17 15:32         ` Eli Zaretskii
2014-12-17 17:18           ` Titus von der Malsburg
2014-12-17 18:21             ` Eli Zaretskii
2014-12-17 18:48               ` Titus von der Malsburg
2014-12-17 19:09                 ` Eli Zaretskii
2014-12-18  3:36                   ` Titus von der Malsburg
2014-12-18 16:15                     ` Eli Zaretskii
2014-12-19 17:09                       ` martin rudalics
2014-12-19 19:35                         ` Eli Zaretskii
2014-12-20 10:09                           ` martin rudalics
2014-12-20 10:59                             ` Eli Zaretskii
2014-12-20 11:42                               ` martin rudalics
2014-12-20 12:45                                 ` Eli Zaretskii
2014-12-20 14:51                                   ` martin rudalics
2014-12-20 16:36                                     ` Eli Zaretskii
2014-12-20 17:50                                       ` martin rudalics
2014-12-20 18:16                                         ` Eli Zaretskii
2014-12-20 18:58                                           ` martin rudalics
2014-12-20 19:52                                             ` Eli Zaretskii
2014-12-21 12:14                                               ` Titus von der Malsburg
2014-12-21 16:43                                                 ` Eli Zaretskii
2014-12-20 14:51                       ` Titus von der Malsburg
2014-12-20 15:06                         ` martin rudalics
2014-12-20 15:21                           ` Titus von der Malsburg
2014-12-20 16:03                             ` martin rudalics
2014-12-20 16:40                               ` Eli Zaretskii
2014-12-20 15:45                           ` Titus von der Malsburg
2014-12-20 16:38                           ` Eli Zaretskii
2014-12-20 17:51                             ` martin rudalics
2014-12-20 18:19                               ` Eli Zaretskii
2014-12-20 16:31                         ` Eli Zaretskii
2014-12-21 22:04                           ` Titus von der Malsburg
2014-12-22 16:00                             ` Eli Zaretskii
2022-04-29 13:14                               ` Lars Ingebrigtsen
2022-06-02 21:41                                 ` Jim Porter
     [not found]                                 ` <a54d35b0-7ed6-374c-2a14-e7d97cf6c0a2@gmail.com>
2022-06-03  3:21                                   ` Lars Ingebrigtsen
2014-12-18 17:16         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bnn39cpe.fsf@posteo.de \
    --to=malsburg@posteo.de \
    --cc=19395@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).