unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#39431: window-text-pixel-size behavior when enabled display-line-number-mode
@ 2020-02-05  8:05 tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-02-05 14:38 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-02-05  8:05 UTC (permalink / raw)
  To: 39431

Hi,
I found unexpected behavior (for me) of window-text-pixel-size.

Environment:
GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, 
cairo version 1.15.10)

Steps:
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?

--
tsuucat





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#39431: window-text-pixel-size behavior when enabled display-line-number-mode
  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
  2020-02-05 14:47   ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2020-02-05 14:38 UTC (permalink / raw)
  To: tsuucat; +Cc: 39431

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)'.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#39431: window-text-pixel-size behavior when enabled display-line-number-mode
  2020-02-05 14:38 ` Eli Zaretskii
@ 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
  0 siblings, 1 reply; 4+ messages in thread
From: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-02-05 14:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 39431


> 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)'.

Oh, I see.
Thanks!

--
tsuucat





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#39431: window-text-pixel-size behavior when enabled display-line-number-mode
  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
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2020-02-05 15:36 UTC (permalink / raw)
  To: tsuucat; +Cc: 39431-done

> From: tsuucat <tsuucat@icloud.com>
> Date: Wed, 5 Feb 2020 23:47:26 +0900
> Cc: 39431@debbugs.gnu.org
> 
> > 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)'.
> 
> Oh, I see.
> Thanks!

Thanks, I'm therefore closing this bug report.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-05 15:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).