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

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

bug#39431: window-text-pixel-size behavior when enabled display-line-num


From: Eli Zaretskii
Subject: bug#39431: window-text-pixel-size behavior when enabled display-line-number-mode
Date: Wed, 05 Feb 2020 16:38:38 +0200

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" <address@hidden>
> 
> 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)'.





reply via email to

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