From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83d15mfqoj.fsf@gnu.org> References: <834lst5bep.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1508207777 9012 195.159.176.226 (17 Oct 2017 02:36:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 17 Oct 2017 02:36:17 +0000 (UTC) Cc: steve@sanityinc.com, 28248@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 17 04:36:13 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4Hjl-0001K8-6p for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Oct 2017 04:36:09 +0200 Original-Received: from localhost ([::1]:36158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4Hjs-0004TV-ET for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Oct 2017 22:36:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4Hii-0003t1-Vx for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 22:35:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4Hig-000480-FP for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 22:35:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35863) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4Hig-00047s-BW for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 22:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e4Hig-0000kE-5I for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 22:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Oct 2017 02:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28248 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28248-submit@debbugs.gnu.org id=B28248.15082076892831 (code B ref 28248); Tue, 17 Oct 2017 02:35:02 +0000 Original-Received: (at 28248) by debbugs.gnu.org; 17 Oct 2017 02:34:49 +0000 Original-Received: from localhost ([127.0.0.1]:44544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4HiT-0000jb-13 for submit@debbugs.gnu.org; Mon, 16 Oct 2017 22:34:49 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45192) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4HiR-0000jN-Oh for 28248@debbugs.gnu.org; Mon, 16 Oct 2017 22:34:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4HiH-0003sJ-Va for 28248@debbugs.gnu.org; Mon, 16 Oct 2017 22:34:42 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38982) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4HiH-0003sF-SJ; Mon, 16 Oct 2017 22:34:37 -0400 Original-Received: from [176.228.60.248] (port=2521 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e4HiH-0006LR-B1; Mon, 16 Oct 2017 22:34:37 -0400 In-reply-to: (message from Dmitry Gutov on Tue, 17 Oct 2017 00:56:45 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:138570 Archived-At: > Cc: 28248@debbugs.gnu.org > From: Dmitry Gutov > 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).