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 10:01:31 +0300 Message-ID: References: <834lst5bep.fsf@gnu.org> <83d15mfqoj.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1508223806 22599 195.159.176.226 (17 Oct 2017 07:03:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 17 Oct 2017 07:03:26 +0000 (UTC) User-Agent: K-9 Mail for Android Cc: 28248@debbugs.gnu.org, Dmitry Gutov To: Steve Purcell Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 17 09:03:19 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 1e4LuC-0003pi-1J for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Oct 2017 09:03:12 +0200 Original-Received: from localhost ([::1]:36884 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4LuG-0003m7-9u for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Oct 2017 03:03:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60933) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4Lu5-0003lu-BV for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 03:03:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4Lu2-0004ik-8q for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 03:03:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36013) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4Lu2-0004ie-55 for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 03:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e4Lu1-0007BN-SS for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 03:03:01 -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 07:03:01 +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.150822372927544 (code B ref 28248); Tue, 17 Oct 2017 07:03:01 +0000 Original-Received: (at 28248) by debbugs.gnu.org; 17 Oct 2017 07:02:09 +0000 Original-Received: from localhost ([127.0.0.1]:44694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4LtB-0007AC-5f for submit@debbugs.gnu.org; Tue, 17 Oct 2017 03:02:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41600) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4LtA-0007A1-2H for 28248@debbugs.gnu.org; Tue, 17 Oct 2017 03:02:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4Lt0-00046F-V5 for 28248@debbugs.gnu.org; Tue, 17 Oct 2017 03:02:02 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41584) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4Lse-0003wB-Ox; Tue, 17 Oct 2017 03:01:36 -0400 Original-Received: from [176.13.228.183] (port=22812 helo=[10.130.128.122]) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e4Lsd-0007px-Cw; Tue, 17 Oct 2017 03:01:36 -0400 In-Reply-To: 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:138584 Archived-At: On October 17, 2017 9:19:11 AM GMT+03:00, Steve Purcell wrote: > On 17 Oct 2017, at 15:34, Eli Zaretskii wrote: > >=20 > >> That would be the actual amount of "screen estate used up for > >> line-number display"=2E > >>=20 > >> Can I rely on the extra value always being 2? > >=20 > > As long as we don't change the implementation, yes=2E 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)=2E >=20 >=20 > Thanks, this is helpful=2E I have some code which calculates the width > of the buffer contents in characters, and calculating this pixelwise > works nicely for me=2E >=20 > The odd thing is that there=E2=80=99s a one character discrepancy betwee= n > graphical and terminal frames=2E It=E2=80=99s not related to the new lin= e > numbers support, since an adjustment for that discrepancy has always > been necessary in the code, and the native line numbers are not > present in the terminal anyway=2E Any idea where that one-column > difference might be coming from? >=20 > https://github=2Ecom/purcell/page-break-lines/blob/610dbdc9d39a37912e2b8= bfbd3e3d15c7e5d622f/page-break-lines=2Eel#L128-L134 The space reserved for the continuation glyph? Note that this can also ha= ppen on GUI frames, if the user disables the fringes=2E Wouldn't window-text-width suit your needs better?