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: Eli Zaretskii
Subject: bug#28248: 26.0.50; display-line-numbers does not affect window-width / window-text-width
Date: Tue, 17 Oct 2017 05:34:20 +0300

> Cc: 28248@debbugs.gnu.org
> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Tue, 17 Oct 2017 00:56:45 +0300
> 
> >    Lisp programs that need to know how much screen estate is used up for
> >    line-number display in a window can use the new function
> >    'line-number-display-width'.
> 
> Does it work as documented? E.g., I can enable 
> display-line-numbers-mode, and they will take up 4 visual columns 
> (numbers plus separators), but (line-number-display-width) returns 2.

That's what it should return.

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





reply via email to

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