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 00:56:45 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Thunderbird/56.0

Hey Eli,

On 8/27/17 5:32 PM, Eli Zaretskii wrote:
and there is also no variable which contains the current width of
the line numbers.  This all means there is no way to determine the
width of the text area of the window.

Yes, there is.  From NEWS:

   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.

Should I always use (+ 2 (line-number-display-width)) instead? 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?





reply via email to

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