From: Eli Zaretskii <eliz@gnu.org>
To: tsuucat <tsuucat@icloud.com>
Cc: 39431@debbugs.gnu.org
Subject: bug#39431: window-text-pixel-size behavior when enabled display-line-number-mode
Date: Wed, 05 Feb 2020 16:38:38 +0200 [thread overview]
Message-ID: <834kw5gkup.fsf@gnu.org> (raw)
In-Reply-To: <9B5DDE93-4222-4E08-BDF0-52C19C67AE8A@icloud.com> (bug-gnu-emacs@gnu.org)
tags 39431 notabug
thanks
> Date: Wed, 5 Feb 2020 17:05:24 +0900
> From: tsuucat via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
> 1. run emacs -Q.
> 2. In *scratch* buffer eval following.
> (window-text-pixel-size nil (point-min) (1+ (point-min)))
> ;=> (9 . 18)
> (display-line-numbers-mode)
> ;=> t
> (window-text-pixel-size nil (point-min) (1+ (point-min)))
> ;=> (45 . 18) ; width changed
>
> I also found this behavior in NS port Emacs 27.0.50.
>
> Is this expected?
Yes. The line-number display is part of the text area, and that's
what this function measures. You will see the same effect if you set
the variable line-prefix to some nonempty string, for example.
If you want the size of the text without the line numbers, you can
subtract the value returned by '(line-number-display-width t)'.
next prev parent reply other threads:[~2020-02-05 14:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-05 8:05 bug#39431: window-text-pixel-size behavior when enabled display-line-number-mode tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-02-05 14:38 ` Eli Zaretskii [this message]
2020-02-05 14:47 ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-02-05 15:36 ` 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=834kw5gkup.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=39431@debbugs.gnu.org \
--cc=tsuucat@icloud.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).