From: Eli Zaretskii <eliz@gnu.org>
To: "Matsievskiy S.V." <seregaxvm.main@gmail.com>
Cc: 41537@debbugs.gnu.org
Subject: bug#41537: 26.3; window-body-width wrong return value when display-line-numbers-mode is on
Date: Tue, 26 May 2020 18:25:33 +0300 [thread overview]
Message-ID: <835zcivhua.fsf@gnu.org> (raw)
In-Reply-To: <454679eb364e5ebfa92d4648d09093542c21fc01.camel@gmail.com> (seregaxvm.main@gmail.com)
tags 41537 notabug
thanks
> From: "Matsievskiy S.V." <seregaxvm.main@gmail.com>
> Date: Tue, 26 May 2020 13:50:38 +0300
>
> `window-body-width` and `window-width` return wrong numbers when
> `display-line-numbers-mode` is on.
>
> For example:
> ```emacs-lisp
> (message (format "Width without line numbers: %d" (window-body-width)))
> (display-line-numbers-mode 1)
> (message (format "Width with line numbers: %d" (window-body-width)))
> ```
>
> return these lines:
> ```
> Width without line numbers: 209
> Width with line numbers: 209
> ```
>
> This is obviously wrong since line numbers take some window space.
This is not wrong, since these functions measure the body without the
line numbers. This is not a bug, but the intended behavior.
> This breaks some packages that rely on `window-body-width` and
> `window-width` to align strings.
Those packages should adapt to display-line-numbers-mode by taking
into account the value returned by line-number-display-width.
next prev parent reply other threads:[~2020-05-26 15:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-26 10:50 bug#41537: 26.3; window-body-width wrong return value when display-line-numbers-mode is on Matsievskiy S.V.
2020-05-26 15:25 ` Eli Zaretskii [this message]
2020-08-13 1:12 ` Stefan Kangas
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=835zcivhua.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=41537@debbugs.gnu.org \
--cc=seregaxvm.main@gmail.com \
/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).