GNU bug report logs - #76734
31.0.50; The line numbers take more space than they need

Previous Next

Package: emacs;

Reported by: the_wurfkreuz <the_wurfkreuz <at> proton.me>

Date: Tue, 4 Mar 2025 06:32:02 UTC

Severity: normal

Found in version 31.0.50

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #16 received at 76734-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: the_wurfkreuz <the_wurfkreuz <at> proton.me>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 76734-done <at> debbugs.gnu.org
Subject: Re: bug#76734: 31.0.50;
 The line numbers take more space than they need
Date: Tue, 4 Mar 2025 21:36:21 +0000
the_wurfkreuz via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

> Sent with Proton Mail secure email.
>
> On Tuesday, March 4th, 2025 at 2:55 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
>
>> tags 76734 notabug
>> thanks
>>
>> > Date: Tue, 04 Mar 2025 06:31:00 +0000
>> > From: the_wurfkreuz via "Bug reports for GNU Emacs,
>> > the Swiss army knife of text editors" bug-gnu-emacs <at> gnu.org
>> >
>> > When using the line-numbers mode, the line numbers start to take an
>> > additional space from a buffer way before the line count reaches 3
>> > digit numbers.
>> >
>> > Steps to reproduce:
>> >
>> > 1. Evaluate:
>> >
>> > (global-display-line-numbers-mode 1)
>> > (setq display-line-numbers 'visual
>> > display-line-numbers-type 'relative)
>> >
>> > (fringe-mode '(1 . 1))
>> >
>> > 2. Then create new lines in the same buffer using the newline
>> > command. In my case i get an additional space on a 38th line already.
>>
>>
>> This is by design. Emacs cannot know how many lines will actually be
>> shown in the window before it actually shows them all. By contrast,
>> it needs to decide how many columns to allocate for line numbers
>> before it displays even a single line, to avoid the annoying
>> horizontal movement of text as much as possible. So it sometimes errs
>> on the safe side (recall that some lines could be smaller than others
>> due to different fonts), to avoid the need to display the window
>> twice, which would significantly punish performance in this mode.
>>
>> Why is that a problem?
>
> If it's done so intentionally, then there is no inherent problem.

Yes, I think it's intentional here, sorry.  Thanks for the bug report,
nevertheless.

I guess the only thing left to do here is to close the bug; I'm doing
that with this message.




This bug report was last modified 79 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.