From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#41537: 26.3; window-body-width wrong return value when display-line-numbers-mode is on Date: Tue, 26 May 2020 18:25:33 +0300 Message-ID: <835zcivhua.fsf@gnu.org> References: <454679eb364e5ebfa92d4648d09093542c21fc01.camel@gmail.com> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="74086"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41537@debbugs.gnu.org To: "Matsievskiy S.V." Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 26 17:26:19 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jdbT7-000J8D-0d for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 26 May 2020 17:26:17 +0200 Original-Received: from localhost ([::1]:47248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdbT6-0004ac-0Z for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 26 May 2020 11:26:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdbSt-0004Xx-9h for bug-gnu-emacs@gnu.org; Tue, 26 May 2020 11:26:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34631) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdbSr-0005az-TY for bug-gnu-emacs@gnu.org; Tue, 26 May 2020 11:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jdbSr-0003Hv-QD for bug-gnu-emacs@gnu.org; Tue, 26 May 2020 11:26: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, 26 May 2020 15:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41537 X-GNU-PR-Package: emacs Original-Received: via spool by 41537-submit@debbugs.gnu.org id=B41537.159050675512627 (code B ref 41537); Tue, 26 May 2020 15:26:01 +0000 Original-Received: (at 41537) by debbugs.gnu.org; 26 May 2020 15:25:55 +0000 Original-Received: from localhost ([127.0.0.1]:46177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdbSl-0003HW-ET for submit@debbugs.gnu.org; Tue, 26 May 2020 11:25:55 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40300) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdbSj-0003HD-OS; Tue, 26 May 2020 11:25:53 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46074) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdbSe-0005Uu-Gz; Tue, 26 May 2020 11:25:48 -0400 Original-Received: from [176.228.60.248] (port=2641 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jdbSd-0002qB-Ew; Tue, 26 May 2020 11:25:48 -0400 In-Reply-To: <454679eb364e5ebfa92d4648d09093542c21fc01.camel@gmail.com> (seregaxvm.main@gmail.com) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:181042 Archived-At: tags 41537 notabug thanks > From: "Matsievskiy S.V." > Date: Tue, 26 May 2020 13:50:38 +0300 > > `window-body-width` and `window-width` return wrong numbers when > `display-line-numbers-mode` is on. > > For example: > ```emacs-lisp > (message (format "Width without line numbers: %d" (window-body-width))) > (display-line-numbers-mode 1) > (message (format "Width with line numbers: %d" (window-body-width))) > ``` > > return these lines: > ``` > Width without line numbers: 209 > Width with line numbers: 209 > ``` > > This is obviously wrong since line numbers take some window space. This is not wrong, since these functions measure the body without the line numbers. This is not a bug, but the intended behavior. > This breaks some packages that rely on `window-body-width` and > `window-width` to align strings. Those packages should adapt to display-line-numbers-mode by taking into account the value returned by line-number-display-width.