From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.help Subject: Re: width of line numbers Date: Tue, 22 Dec 2020 11:12:14 +0100 Message-ID: <87r1ni9mkh.fsf@gmx.net> References: <87eejip4ju.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19176"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: gnu-emacs-help@gnu.org To: Joost Kremers Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 22 11:12:48 2020 Return-path: Envelope-to: geh-help-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 1kreeu-0004tR-1i for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 22 Dec 2020 11:12:48 +0100 Original-Received: from localhost ([::1]:54962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kreet-0000yu-4M for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 22 Dec 2020 05:12:47 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kreeY-0000yk-KA for help-gnu-emacs@gnu.org; Tue, 22 Dec 2020 05:12:26 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:56205) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kreeY-0003pW-Do for help-gnu-emacs@gnu.org; Tue, 22 Dec 2020 05:12:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55048) by fencepost.gnu.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kreeX-000153-Kc for gnu-emacs-help@gnu.org; Tue, 22 Dec 2020 05:12:25 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:36003) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kreeV-0003nW-MY for gnu-emacs-help@gnu.org; Tue, 22 Dec 2020 05:12:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1608631937; bh=P8KS+yzQTVqcoiDaMd8uJ+KFkOJfMT2kPDsguWowvbY=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=kPV5WBTXx+dYNledJN7xbDfxu33Pw8sCjs22gVjr4Pc+KJyBjwEn3rVRNtT6BrlIT vLT2VkV9ez6dQnMgm818nxG7t8K4e/OXdFtS8fxDKsoWHC3R/UEMdkwplmXZq9F0oQ 8uCs4fgloJ4Nqwkuwa+8bqOxgu3GDcuQs6lBmSh0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from strobe-jhalfs ([92.73.70.249]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MWzfl-1kXZe429UX-00XOpP; Tue, 22 Dec 2020 11:12:17 +0100 In-Reply-To: <87eejip4ju.fsf@fastmail.fm> (Joost Kremers's message of "Tue, 22 Dec 2020 10:23:26 +0100") X-Provags-ID: V03:K1:ZRQStdNHeIb337fVrc9Xk1IPZICrc9mUFdSq1ym/GROgbqs+Vb+ rmPZHvi9ACOxluF/PvUs4QsQogVrz5tYiz9WxH5c0foN/ZQPFXUpac8+vQ2rIaCtcuyuX1Y pchnjxjwi8JSNugpixU4Ak9N6X65HjTs5LudUdyD34kBvgm7tmRHjlCflSD8rg3PwC8sxIv CoDFOFTd1qiq6/bsRaHoA== X-UI-Out-Filterresults: notjunk:1;V03:K0:qeD/OAqubnc=:HNGzs0WQX+K6oM2noGv11R gBvH+qzEcuqm5ZVjwJmiTeTHPu1soz/WoENt8PXBTpQkG4JmX2bKtNfLg7jBORVMf/iHhDyQS P+cGW215mgCR4zuNDraxS5TRMbr4PdNvHhF4SugaPOqW7O5xpga5PxSvv4zDpWDO9Iit240PZ bN92Kb6G9j0X7OEn6Y7znDLL4Dg0zj4e7tSm6juZD+N70Mej1XgTIRlOOjZUR8vYcTarleTRe DKAqb8ZNNR1mL2Wkr4p8SEZhR03DYEeGGN9caKeBN52p7jxMB7cuRf68M9KDFSwxC/hyEOPzA F4T3VifgXVpsRU9sjTekIAqYpbyrnxeuqzSXMWmjrF/g+qGI3dSV726n/Yg9dGFTXQSd/6T7E 0UM4ByAR2iDDVViHcYb5VSuE9pkLyVDNZPLJwCEBJ+VdUeKim7MCZ+3PuU5XLfVpMFKiN5lsy Jkcdc4AvWvdLHFicxZLAY+BPxAZ9xz7HfeJHOpWsnvW7oiwMD+YDWW3KBn5DD//5V+ngQ4scF dZHHPxpoiIWdBKZJHbW6mGXcHOHTOcFLTDRCKBo5IUni8w3kvSOckFeOYKjp3tmoSdd4bjeKH zR19zaOzJXCwLlf1OuysOKGQIVw9LO3QCHukOUxfviKbjIAlqMtDD7C7cEoTMC1ubIzuYEHDo Uc18l61NLHJMuiXQi1XRW/lUes0TZLXVTJ320Ej4pIAGlFfBYpDS8Ew8ZGlRN988o0RMWn+6Y tDEZkvEsnlCde8mHeA9lticYSujoJt9OFTV9SmLkCEzcHeH7Tjw7ehqA1r10Zy0/2psKtwti Received-SPF: pass client-ip=212.227.17.21; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:126668 Archived-At: On Tue, 22 Dec 2020 10:23:26 +0100 Joost Kremers = wrote: > Hi all, > > I was wondering if there's a way to find out the width of the current line > number display (with `display-line-number-mode`, not `linum-mode`). (line-number-display-width) > Or, alternatively, get the window width without the line number. This should do it: (- (window-body-width) (line-number-display-width)) >=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 > Both > `window-body-width` and `window-total-width` (why are there two functions= , BTW?) > report the width of the text area without "dividers, scrollbars, margins, > fringes", but the line number display is still included. Actually, window-total-width "includes the widths of WINDOW=E2=80=99s fring= es, margins, scroll bars and its right divider, if any." Steve Berman