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

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

bug#28248: 26.0.50; display-line-numbers does not affect window-width /


From: Dmitry Gutov
Subject: bug#28248: 26.0.50; display-line-numbers does not affect window-width / window-text-width
Date: Tue, 17 Oct 2017 11:23:56 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Thunderbird/56.0

On 10/17/17 5:34 AM, Eli Zaretskii wrote:

Should I always use (+ 2 (line-number-display-width)) instead?

If you need it in columns, yes.  This is for consistency with the
value of display-line-numbers-width, which you can set.

That would be the actual amount of "screen estate used up for
line-number display".

Can I rely on the extra value always being 2?

As long as we don't change the implementation, yes.  Alternatively,
you can call line-number-display-width with the optional argument and
get the result in pixels, in which case it includes everything (you
can divide by frame-char-width to get the result back in columns).

Thanks, but isn't that more inconsistent? I would expect both return values of this function to measure the same thing, and there's nothing in the docstring to explain that difference.

On the other hand, the return value of the function can differ from what a variable is set to.

I guess I could live with that, but the function's docstring needs updating.





reply via email to

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