From unknown Sat Jun 14 19:13:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41537: 26.3; window-body-width wrong return value when display-line-numbers-mode is on Resent-From: "Matsievskiy S.V." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 May 2020 13:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41537 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 41537@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159049806830205 (code B ref -1); Tue, 26 May 2020 13:02:01 +0000 Received: (at submit) by debbugs.gnu.org; 26 May 2020 13:01:08 +0000 Received: from localhost ([127.0.0.1]:44396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdZCd-0007r1-RZ for submit@debbugs.gnu.org; Tue, 26 May 2020 09:01:08 -0400 Received: from lists.gnu.org ([209.51.188.17]:41166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdXAT-0002XL-7p for submit@debbugs.gnu.org; Tue, 26 May 2020 06:50:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdXAS-0003sl-T3 for bug-gnu-emacs@gnu.org; Tue, 26 May 2020 06:50:44 -0400 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]:37977) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdXAR-0002ZI-6K for bug-gnu-emacs@gnu.org; Tue, 26 May 2020 06:50:44 -0400 Received: by mail-lj1-x243.google.com with SMTP id m18so23886197ljo.5 for ; Tue, 26 May 2020 03:50:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:user-agent:mime-version :content-transfer-encoding; bh=VH5fZ5NeX2H238z1Ayc+exUhdCs/5NHS0dUcCAm7GuU=; b=PZw1eFtfejib/XqCE22V38DvQioy2sEgak4S4k0L7/N/szrERrxrvtABsv8J9EqkfU xZEGbUA6zgJJ0n4gzP24474fygGolQGUw7px5vx2en+GbrGk5vbi2c3geRtM/ARv/jnL mA1gEZOhgfgxbFk2oeRo2+760VRIfmrkyF6/YlUrlyAIcKmql6YTHyeS+TRYGgHpDH/N 8Jwws5+ylQgP2gyXpGbOAcOopariDJ9yQgi2ikxOm0UPNLnRg+IancM7nhrTWA4olzg3 BReLLzBwifxIYIP+Oh2QgPZ+jDJcmSz7DRs0E4JUi+hO4Zp4PHzfNCxdSavVtBTX0w4I +8dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:user-agent :mime-version:content-transfer-encoding; bh=VH5fZ5NeX2H238z1Ayc+exUhdCs/5NHS0dUcCAm7GuU=; b=kw3lT3Ub7qhkZYOTOkIm5rLzGS4tEjCylNeM3LkHvHYEOV+tQlqvPOV6Gu1ixFb32N pM1tstyGJjotiWkj2n78m3B65a5DFKR4l6zoiO0ITnw0aoDaUtf/xcUwkWt52I8xt+PQ 4XvIf3TcCTISrTQHUEh6hM1pEO7Fhm1rTK3i5OtBujPVEgSspxI7Ka7PX/E5AAjqKVUj FSudafCCkMICXAKGeieEPO2+ee6YePPh+4NGyT2e199JpFA1rY5+Y7ydaDTDrr88vxag YWVOfa4DSZe/WtI0GDxGvQ4YdfGCYzQogi/F9gKthfx3/ZqN/XOO//iP0zKDYom2N4xF FDvg== X-Gm-Message-State: AOAM533jDPdgyVodkkvn5SzBdXsWm3wXLv+hwquPpIr4lTMJ7MpFMud+ cdsnXMD8I5pMf24QuZJs2yFxpys/ X-Google-Smtp-Source: ABdhPJwNk0mnMZ2WrvwT8NwghVQlpI18YmeE9SwyeXkudvBXprr+Y8eb3vkoPTmKgEpSQKknfABG3g== X-Received: by 2002:a05:651c:39d:: with SMTP id e29mr295514ljp.463.1590490240211; Tue, 26 May 2020 03:50:40 -0700 (PDT) Received: from [192.168.0.2] ([46.188.59.176]) by smtp.gmail.com with ESMTPSA id u4sm3560382lfl.18.2020.05.26.03.50.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 03:50:39 -0700 (PDT) Message-ID: <454679eb364e5ebfa92d4648d09093542c21fc01.camel@gmail.com> From: "Matsievskiy S.V." Date: Tue, 26 May 2020 13:50:38 +0300 Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.2-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::243; envelope-from=seregaxvm.main@gmail.com; helo=mail-lj1-x243.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: 3.0 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: `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))) `` [...] Content analysis details: (3.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: x.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (seregaxvm.main[at]gmail.com) 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [209.51.188.17 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 2.0 SPOOFED_FREEMAIL No description available. X-Mailman-Approved-At: Tue, 26 May 2020 09:01:03 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) `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 breaks some packages that rely on `window-body-width` and `window-width` to align strings. In GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20) of 2020-05-17, modified by Debian built on x86-csail-01 Windowing system distributor 'The X.Org Foundation', version 11.0.12008000 System Description: Debian GNU/Linux bullseye/sid Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Mark set Width without line numbers: 209 Width with line numbers: 209 Configured using: 'configure --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.3/site- lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.3/site- lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.3/site- lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.3/site- lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/emacs-mHAik2/emacs-26.3+1=. -fstack- protector-strong -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LIBSYSTEMD LCMS2 Important settings: value of $LANG: en_GB.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: display-line-numbers-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils thingatpt help-fns radix-tree help-mode easymenu cl-loaddefs cl-lib misearch multi-isearch display-line-numbers cus-start cus-load elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print- readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 109750 7626) (symbols 48 21505 1) (miscs 40 68 215) (strings 32 32568 1315) (string-bytes 1 804681) (vectors 16 14249) (vector-slots 8 504282 12068) (floats 8 53 281) (intervals 56 492 14) (buffers 992 13)) From unknown Sat Jun 14 19:13:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#41537: 26.3; window-body-width wrong return value when display-line-numbers-mode is on 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 X-GNU-PR-Keywords: To: "Matsievskiy S.V." Cc: 41537@debbugs.gnu.org Received: via spool by 41537-submit@debbugs.gnu.org id=B41537.159050675512627 (code B ref 41537); Tue, 26 May 2020 15:26:01 +0000 Received: (at 41537) by debbugs.gnu.org; 26 May 2020 15:25:55 +0000 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 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 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 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 Date: Tue, 26 May 2020 18:25:33 +0300 Message-Id: <835zcivhua.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <454679eb364e5ebfa92d4648d09093542c21fc01.camel@gmail.com> (seregaxvm.main@gmail.com) References: <454679eb364e5ebfa92d4648d09093542c21fc01.camel@gmail.com> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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. From unknown Sat Jun 14 19:13:48 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: "Matsievskiy S.V." Subject: bug#41537: closed (Re: bug#41537: 26.3; window-body-width wrong return value when display-line-numbers-mode is on) Message-ID: References: <454679eb364e5ebfa92d4648d09093542c21fc01.camel@gmail.com> X-Gnu-PR-Message: they-closed 41537 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: notabug Reply-To: 41537@debbugs.gnu.org Date: Thu, 13 Aug 2020 01:13:04 +0000 Content-Type: multipart/mixed; boundary="----------=_1597281184-16230-1" This is a multi-part message in MIME format... ------------=_1597281184-16230-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #41537: 26.3; window-body-width wrong return value when display-line-number= s-mode is on which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 41537@debbugs.gnu.org. --=20 41537: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D41537 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1597281184-16230-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 41537-done) by debbugs.gnu.org; 13 Aug 2020 01:12:48 +0000 Received: from localhost ([127.0.0.1]:46220 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k61nT-0004Cj-Qa for submit@debbugs.gnu.org; Wed, 12 Aug 2020 21:12:47 -0400 Received: from mail-yb1-f171.google.com ([209.85.219.171]:33563) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k61nR-0004C2-OW for 41537-done@debbugs.gnu.org; Wed, 12 Aug 2020 21:12:46 -0400 Received: by mail-yb1-f171.google.com with SMTP id p191so2421003ybg.0 for <41537-done@debbugs.gnu.org>; Wed, 12 Aug 2020 18:12:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=OKaMhpi3+TrA47ZEzhI73gXJ94Iz7Zxx8D4mHo3jesk=; b=bpflWmozje4IEoIJJ3aY0r6zQqQlb9b2bupuB5SBCfyhU51x924gdNjv5zI7wTX25X KUPj0l1Lt6aspZHzB2AWxwVUu6NVKd11Lrz5UQdBFALwIir+fkiIlfkeBuYQtcnf+NA3 +6Or3Qds59vC7FXkGFJVkTUMpneIoJHzFrdakc3TavXwXO4lAF2jOCW2Qjlub/JPeRw+ u32u1NDyIoWpATCI4OY8i1gQLc+BI2Otg24gESYBHPu0ZQeoPZzvVSAOXhJ/VRtQFX1u FtMELUentcNSaef6/vKNaPcJEN1bAbsUe7a/NGaFlcR/oQ+6eDhPhBEI6x64rSrWLzIB 2aHw== X-Gm-Message-State: AOAM53019bXSq9ilSzQFxs3VUqH8gshPzoMRBSFgssMJ7Mv/vqr7ZZDQ H2Met3OYYrMP/cnDPRUbEFlBCcIfeEk8sQWSg+63ajozWpI= X-Google-Smtp-Source: ABdhPJw1RiW2C7S/6w+Gqnzbj+Toay//LxlSdjoSw/JOJVH9YbR0p/NVf2G0pO0LNkAHXPin21ix5yohPXCubEy3s7g= X-Received: by 2002:a25:b88b:: with SMTP id w11mr3294842ybj.129.1597281160523; Wed, 12 Aug 2020 18:12:40 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 12 Aug 2020 18:12:40 -0700 From: Stefan Kangas In-Reply-To: <835zcivhua.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 26 May 2020 18:25:33 +0300") References: <454679eb364e5ebfa92d4648d09093542c21fc01.camel@gmail.com> <835zcivhua.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Date: Wed, 12 Aug 2020 18:12:40 -0700 Message-ID: Subject: Re: bug#41537: 26.3; window-body-width wrong return value when display-line-numbers-mode is on To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 41537-done Cc: 41537-done@debbugs.gnu.org, "Matsievskiy S.V." X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > 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. I'm therefore closing this bug report. Best regards, Stefan Kangas ------------=_1597281184-16230-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 26 May 2020 13:01:08 +0000 Received: from localhost ([127.0.0.1]:44396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdZCd-0007r1-RZ for submit@debbugs.gnu.org; Tue, 26 May 2020 09:01:08 -0400 Received: from lists.gnu.org ([209.51.188.17]:41166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdXAT-0002XL-7p for submit@debbugs.gnu.org; Tue, 26 May 2020 06:50:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdXAS-0003sl-T3 for bug-gnu-emacs@gnu.org; Tue, 26 May 2020 06:50:44 -0400 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]:37977) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdXAR-0002ZI-6K for bug-gnu-emacs@gnu.org; Tue, 26 May 2020 06:50:44 -0400 Received: by mail-lj1-x243.google.com with SMTP id m18so23886197ljo.5 for ; Tue, 26 May 2020 03:50:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:user-agent:mime-version :content-transfer-encoding; bh=VH5fZ5NeX2H238z1Ayc+exUhdCs/5NHS0dUcCAm7GuU=; b=PZw1eFtfejib/XqCE22V38DvQioy2sEgak4S4k0L7/N/szrERrxrvtABsv8J9EqkfU xZEGbUA6zgJJ0n4gzP24474fygGolQGUw7px5vx2en+GbrGk5vbi2c3geRtM/ARv/jnL mA1gEZOhgfgxbFk2oeRo2+760VRIfmrkyF6/YlUrlyAIcKmql6YTHyeS+TRYGgHpDH/N 8Jwws5+ylQgP2gyXpGbOAcOopariDJ9yQgi2ikxOm0UPNLnRg+IancM7nhrTWA4olzg3 BReLLzBwifxIYIP+Oh2QgPZ+jDJcmSz7DRs0E4JUi+hO4Zp4PHzfNCxdSavVtBTX0w4I +8dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:user-agent :mime-version:content-transfer-encoding; bh=VH5fZ5NeX2H238z1Ayc+exUhdCs/5NHS0dUcCAm7GuU=; b=kw3lT3Ub7qhkZYOTOkIm5rLzGS4tEjCylNeM3LkHvHYEOV+tQlqvPOV6Gu1ixFb32N pM1tstyGJjotiWkj2n78m3B65a5DFKR4l6zoiO0ITnw0aoDaUtf/xcUwkWt52I8xt+PQ 4XvIf3TcCTISrTQHUEh6hM1pEO7Fhm1rTK3i5OtBujPVEgSspxI7Ka7PX/E5AAjqKVUj FSudafCCkMICXAKGeieEPO2+ee6YePPh+4NGyT2e199JpFA1rY5+Y7ydaDTDrr88vxag YWVOfa4DSZe/WtI0GDxGvQ4YdfGCYzQogi/F9gKthfx3/ZqN/XOO//iP0zKDYom2N4xF FDvg== X-Gm-Message-State: AOAM533jDPdgyVodkkvn5SzBdXsWm3wXLv+hwquPpIr4lTMJ7MpFMud+ cdsnXMD8I5pMf24QuZJs2yFxpys/ X-Google-Smtp-Source: ABdhPJwNk0mnMZ2WrvwT8NwghVQlpI18YmeE9SwyeXkudvBXprr+Y8eb3vkoPTmKgEpSQKknfABG3g== X-Received: by 2002:a05:651c:39d:: with SMTP id e29mr295514ljp.463.1590490240211; Tue, 26 May 2020 03:50:40 -0700 (PDT) Received: from [192.168.0.2] ([46.188.59.176]) by smtp.gmail.com with ESMTPSA id u4sm3560382lfl.18.2020.05.26.03.50.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 03:50:39 -0700 (PDT) Message-ID: <454679eb364e5ebfa92d4648d09093542c21fc01.camel@gmail.com> Subject: 26.3; window-body-width wrong return value when display-line-numbers-mode is on From: "Matsievskiy S.V." To: bug-gnu-emacs@gnu.org Date: Tue, 26 May 2020 13:50:38 +0300 Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.2-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::243; envelope-from=seregaxvm.main@gmail.com; helo=mail-lj1-x243.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: 3.0 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: `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))) `` [...] Content analysis details: (3.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: x.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (seregaxvm.main[at]gmail.com) 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [209.51.188.17 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 2.0 SPOOFED_FREEMAIL No description available. X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 26 May 2020 09:01:03 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) `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 breaks some packages that rely on `window-body-width` and `window-width` to align strings. In GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20) of 2020-05-17, modified by Debian built on x86-csail-01 Windowing system distributor 'The X.Org Foundation', version 11.0.12008000 System Description: Debian GNU/Linux bullseye/sid Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Mark set Width without line numbers: 209 Width with line numbers: 209 Configured using: 'configure --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.3/site- lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.3/site- lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.3/site- lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.3/site- lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/emacs-mHAik2/emacs-26.3+1=. -fstack- protector-strong -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LIBSYSTEMD LCMS2 Important settings: value of $LANG: en_GB.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: display-line-numbers-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils thingatpt help-fns radix-tree help-mode easymenu cl-loaddefs cl-lib misearch multi-isearch display-line-numbers cus-start cus-load elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print- readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 109750 7626) (symbols 48 21505 1) (miscs 40 68 215) (strings 32 32568 1315) (string-bytes 1 804681) (vectors 16 14249) (vector-slots 8 504282 12068) (floats 8 53 281) (intervals 56 492 14) (buffers 992 13)) ------------=_1597281184-16230-1--