From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 15 03:56:58 2017 Received: (at submit) by debbugs.gnu.org; 15 Oct 2017 07:56:58 +0000 Received: from localhost ([127.0.0.1]:40897 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3dn8-0002hc-IQ for submit@debbugs.gnu.org; Sun, 15 Oct 2017 03:56:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3dn7-0002hP-04 for submit@debbugs.gnu.org; Sun, 15 Oct 2017 03:56:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3dn0-0007Dj-Nt for submit@debbugs.gnu.org; Sun, 15 Oct 2017 03:56:51 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:41213) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3dn0-0007Df-Kq for submit@debbugs.gnu.org; Sun, 15 Oct 2017 03:56:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3dmz-0001bU-Bz for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 03:56:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3dmw-0007Ck-Av for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 03:56:49 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:54199) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3dmw-0007C4-2r for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 03:56:46 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id C90FF20AB4 for ; Sun, 15 Oct 2017 03:56:43 -0400 (EDT) Received: from web5 ([10.202.2.215]) by compute3.internal (MEProxy); Sun, 15 Oct 2017 03:56:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paulwrankin.com; h=content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=/+TAC6uAyRVd4+rDcX8FuwbWwWNujIHtXy472V5u364=; b=KzagQgws l74a3YpA1skmqbuZMDtR2Bpmu6PsIvCmWSnQclIJXx3NcVxWKeDveiWucy14e8zx a8k0yDM9EapU7W25TGGwHW0XFjOshQ3Q62+uM0+DpCjnUbo7+CICualnOiZjO0kp 7j9HDI3dSRAd7dEL2juzHbTqtuJVFBZm7RYAJIB5QlZyEalNY+8IEw332QuUuHqU MCyRMqGUpW6GtJHLCs+Qa6OLu863YZlNf5ufDPC7weOjDYUJOhea9F5/AF1EgXwi hQdaiMSUrodKmwdEhYP8kv5bJci9pV5hB/r4OzPSjHjkqZpGe0wHXVn5OCm4Sx3P 2PsGzqTVpTLy6g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=/+TAC6uAyRVd4+rDcX8FuwbWwWNuj IHtXy472V5u364=; b=AWtcwJQ5aoU1EavE6V+doLxZrN1gn/0rj5kM8dOI3g1zV 6OO6KXSwYBL8HR35t2buQxkZxVXthaf5liPFcBqfVhI0YljdwMHgK1GJyUmRF8Dq aWporHRFmToBCWCh2LCxw5pvLY6OoVisMwhs4kX+IYKn2LuRtgkNcfxqxQEL4tFV rrzKPL1qGd/nGVJvssHC/qY2p/GGhHuqlVwGGYGvXa9GCzJsTmD0PXueoTvm9zXF gaMvdX9xMfTQighfM8+ruGa6ZWc+5vgGA3uMgO+FAMVVy5NAmd+FPVeLQWuXhANk wBIZK+1NJse+IlNdyQXOvauwtk91al4Mhsw7br+Yw== X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 97E2A9E2F7; Sun, 15 Oct 2017 03:56:43 -0400 (EDT) Message-Id: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> From: Paul Rankin To: bug-gnu-emacs@gnu.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-26fdae60 Date: Sun, 15 Oct 2017 17:56:43 +1000 Subject: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit 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: -5.0 (-----) Activating/deactivating display-line-numbers-mode alters the window configuration and so should call window-configuration-change-hook but does not. >From the Emacs NEWS file: > 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'. This is nice, but in order to use this, we need to know when to act upon it, e.g. when display-line-numbers-mode affects the window configuration. Or, if there is a more appropriate hook. To reproduce: 1. emacs -Q 2. add a hook to window-configuration-change-hook 3. M-x display-line-numbers-mode Expected results: Hook added should run when enabling display-line-numbers. Actual results: Hook is not run. Configuration: GNU Emacs 26.0.90 (build 1, x86_64-apple-darwin17.0.0) of 2017-10-15 macOS 10.13 (17A405) MacBook Pro (Retina, 15-inch, Mid 2015) 2.2 GHz Intel Core i7 16 GB 1600 MHz DDR3 Intel Iris Pro 1536 MB From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 15 05:41:45 2017 Received: (at 28844) by debbugs.gnu.org; 15 Oct 2017 09:41:45 +0000 Received: from localhost ([127.0.0.1]:40960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3fQX-0005O8-MT for submit@debbugs.gnu.org; Sun, 15 Oct 2017 05:41:45 -0400 Received: from mout.gmx.net ([212.227.17.20]:52461) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3fQV-0005Nu-7v for 28844@debbugs.gnu.org; Sun, 15 Oct 2017 05:41:44 -0400 Received: from [192.168.1.100] ([46.125.250.23]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MK0bZ-1e4UEl2t0v-001UPL; Sun, 15 Oct 2017 11:41:34 +0200 Message-ID: <59E32D49.4030007@gmx.at> Date: Sun, 15 Oct 2017 11:41:29 +0200 From: martin rudalics MIME-Version: 1.0 To: Paul Rankin , 28844@debbugs.gnu.org Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> In-Reply-To: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:5pWOqMRNlQ3FFJFkyH1heVOq/cmWVDkiTyx/UJ18HWm6QAWcXuQ RBjv3zBdbtpxukvsngCETv+m5OOfjLZKYMXi/ZKOTlz4cGjyTSoVFM/CrbnmU0wr3eK8/7h fdEYt1CGhiMK28+JA4/k1Dj8NbEh/TvcqVhbSYO7zRaH8Yk8OedYu8WnScOvJfNB6iDlX1O 497DhhIuZcdAuJWImwVLw== X-UI-Out-Filterresults: notjunk:1;V01:K0:J4oKzN0Ybb0=:jxBizAB+Q/pkKAmuMBONVl zxCipJy7s0kr4xblw6ZKeGS2xfpvDHXSD6drwBtJ3tlzTDqmiAnuZXbBdy3W15e5JK3UlW/B/ ULbdmqNf1+y72gExB11P7ghFwq4iQa7aJfvj2Edufne4h94TE0MZOk2KN0JuQiQt0uj3x434e kLyY//4SW6H9oDMOWwDz7pNHobPySPt4m/csxP6g31wAplQSc+XBw3FN1SxVZ7yotCGEyOpec wVGGksS0w/etV7Y+iGPjLVcfqLS40uX/2OjXmwq/HFvsl4mZymoKQByHA3Sn7nSFUQrhOQqcV Pdhc+YK+WsyUBuP1SG//p5AtJzy5qY60wd5xObsopMdghf8qg68fb+aPHO4PDhhwGDtDPPZpq Tlr8rIXvCKpzbLcHJDbYi8KcKP/PkNOnlmLcLqTR6Dd37gi7u/Fo8jQEe3h+mSP7PG3Pg2Wyt Cx9sD18KSwwzB9C16qlzWcOjVHNCKKfNv2x7Ca9gAylZEwYDdhTd49IQelXyBAvQLwtU1vLWd rKVW7dRkXAZ/uRwSQhaQVuYcF5oRiJeQGdIMdQd9ib7MJdIAkvrNDTq0Pmvyp7k8FEHcT5dEI eNKOS+g2gISZL5c5WPKTF2nO6LSQ8kkrM4+j+HeWKJaE1W4L1s2GtktdGqXyyIVkI4Q7Fw5Y/ +GvWY3loAUcJKy94o/E3v2urTsqDuQmMz/fY+cXWRPRaIGp0ihaDkNGiyNiH6Eku/a3yNGcJu FcS8DXlkITNQLz5dimTUNXSfntce/tueMZ241cBiBAJQGcrgaQcCIVl1keV0DeYyLb2whhI61 UDZoWnJpOxh2rOWnRk6EPcdxH/MvQRTdsaVmCjW2NmYdF6+zdeeKUYOIuZuhmj0TCVcUraP X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 28844 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.0 (---) > Activating/deactivating display-line-numbers-mode alters the window > configuration and so should call window-configuration-change-hook but > does not. =E2=80=98window-configuration-change-hook=E2=80=99 is still run way too o= ften, for example, when windows get resized. =E2=80=98window-size-change-functions= =E2=80=99 might be better. But if you need such a hook, wouldn't you also need it when line numbers occupy more or less columns, for example, during scrolling? Otherwise, why can't you use =E2=80=98display-line-numbers-mode-hook=E2=80= =99? martin From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 15 07:08:41 2017 Received: (at 28844) by debbugs.gnu.org; 15 Oct 2017 11:08:41 +0000 Received: from localhost ([127.0.0.1]:41001 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3gmf-0007du-4I for submit@debbugs.gnu.org; Sun, 15 Oct 2017 07:08:41 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:59477) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3gmd-0007dk-KC for 28844@debbugs.gnu.org; Sun, 15 Oct 2017 07:08:39 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 7C8AC20BC9; Sun, 15 Oct 2017 07:08:37 -0400 (EDT) Received: from web5 ([10.202.2.215]) by compute3.internal (MEProxy); Sun, 15 Oct 2017 07:08:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paulwrankin.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=0hvqPkToHSdt1ODcd m/dE4lnDTLHIXNBqaqTffLccBQ=; b=uaSB8/oSGeX7yzV+//WUbBYNjFwQu91dr G5/3ae3uIgg3bhtGXWfxpdhObLrTUTlhtGbgZN9FvBtA4bRtRHArN2Av6aris2gn ntpr84gjaFUFsOcpCCxsfI8kOcJj70KRjCbY6UpoYFetx+Ucn2inNjUPlT9wim4R SSyswGPtYSxHjf2dI2FYx/LmZJ2Sjf8ifMnJ6iUqDjwPs3S7TJoUvXOx9HHjb11b 9eZ797Z4JJdc95eb2ZilKbPj4OaxmLoqR6de6t+BeSkiN42jZ89VcIvOUi2MVTtK K5VU+0NyrW/C3OPB0m2VtYVqP7D17m5wUTpXlNzDQpsj82QlyKlvQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=0hvqPk ToHSdt1ODcdm/dE4lnDTLHIXNBqaqTffLccBQ=; b=L7/CC7mdk147j8UA3l2vnP pA2+Iz0V/A5NxmlSebEMobJ9bLR01UEAlq2mJQC5WSIv+FvIa3bdm0hcgzxKS9FJ mPJnLypOk6Xqy4qxdt2NxoLUrwf2mUM7PxoaS3mA80dgoaAj8Fl8WiCS/C5BqfZ9 4bdWlpz0Et68mS0FHOQxMMLqBxyLQlEFqpicbkZd6ZA37D4xbeRBuckr96L2UbNK JuGxufoTtdLKWzbkZHr4kOTHOjVaCOdHejdSl4uWiYTdg7QF2fVco69Ez6KWKKZz SgwoNWTV58skAMmVVosiRLXLnFnSpirWtEtrGDQlBU2nUNtSJ7Hr8v+/KoqZD1ag == X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 53CE79E2EE; Sun, 15 Oct 2017 07:08:37 -0400 (EDT) Message-Id: <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> From: Paul Rankin To: martin rudalics MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-26fdae60 In-Reply-To: <59E32D49.4030007@gmx.at> Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> Date: Sun, 15 Oct 2017 21:08:37 +1000 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 28844 Cc: 28844@debbugs.gnu.org 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: -0.7 (/) On Sun, 15 Oct 2017, at 07:41 PM, martin rudalics wrote: > > Activating/deactivating display-line-numbers-mode alters the window > > configuration and so should call window-configuration-change-hook but > > does not. >=20 > =E2=80=98window-configuration-change-hook=E2=80=99 is still run way too o= ften, for > example, when windows get resized. =E2=80=98window-size-change-functions= =E2=80=99 might > be better. But if you need such a hook, wouldn't you also need it when > line numbers occupy more or less columns, for example, during scrolling? >=20 > Otherwise, why can't you use =E2=80=98display-line-numbers-mode-hook=E2= =80=99? Thanks for pointing me to display-line-numbers-mode-hook, but I=E2=80=99ve = found that it=E2=80=99s not enough to just check when the mode is enabled. = We need to alert other concerned modes whenever display-line-numbers-mode c= hanges the margins, e.g. due to scrolling from line 99 to 100 (which will i= ncrease the width from 2 to 3). From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 15 08:12:48 2017 Received: (at 28844) by debbugs.gnu.org; 15 Oct 2017 12:12:48 +0000 Received: from localhost ([127.0.0.1]:41023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3hmi-0002gp-0G for submit@debbugs.gnu.org; Sun, 15 Oct 2017 08:12:48 -0400 Received: from mout.gmx.net ([212.227.17.22]:53669) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3hmf-0002gY-T7 for 28844@debbugs.gnu.org; Sun, 15 Oct 2017 08:12:46 -0400 Received: from [192.168.1.100] ([46.125.250.23]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MMkgl-1eAZw33Eb9-008e6h; Sun, 15 Oct 2017 14:12:36 +0200 Message-ID: <59E350AE.3060005@gmx.at> Date: Sun, 15 Oct 2017 14:12:30 +0200 From: martin rudalics MIME-Version: 1.0 To: Paul Rankin Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> In-Reply-To: <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:DURq7ikMc5BKS6jMqGvOhtc8cn77cni5EYYzfT8oH2slWiz96ng O8Giz4UV50QRmTbzlluOLd1TSG6v+5aNTQJyekig9Ewqm8nVVAQsd2Qtj5HNBIezc8+sLn4 m3qcpKv6BWxa1xO4qIkKMcyiUTITZIm5ep9UyKadMQj75a/XnAMtpWZZs4xctXD/KzifT5h IygSHmTCxEL+Th+wb+PVg== X-UI-Out-Filterresults: notjunk:1;V01:K0:BRC9Zqfe5i0=:kAZcNFGmGw4pNk21Zi7faU rrdP/27gtMciSAZwbXFwKb8PMXnhtErycOoYTyi2qZSuaMnE+s3/WyNyAvKoOEf7vz9Efs5oD Hjo/cvQ5BihHvYtiihguPW8NVhuBJc+gDYq6nB7lbwOjGZZ7fgeZkdV/s2uEDQ+81ZHRjEXmH 2Iq3MzXhk/aLkWwo9HBY1ZNiNvdpo4FZ4h4plrXfbwOqzOID5y7iZVNmQe0CK+zTCMd2uwfHX hqRMo1QlEyLIFDo10BqEk0SAN8yop0l9egu+BfanJWq8v9vsKxN+0gvLshnhU94+jOnPwDcQZ 6aOVZn8iw1BVr5xEIUhnMB+ZZT5gIvKKmpL4fOSJWzvfhI2tAVlZKa3t/Wr+94LzmF3idCXnP MF+QwhIW2bOIsuuFWTTsJzdQIyeXCIUz4NNXbaOnWXTw/83Rqv+/Ikk4RhAEPt/4Pu/oFmCPh 6VdCrfhHdd0NvWYL+lrdRftSRbfQdAjLbDs0P+svE7OFEKwD8azCCXAEKrWzlWVM1t9L0iEcM KtTGfsWYM54PnzEwYBbaxW3DNJ0NIZIIXlIjwywAvF43x1jRxwAqKW7PvolzOgYw7/wXJOVoP hDNwEqwJbEjjZ4sprTnj4S6KvBrUcpR4+lpfqcItLLgKneQPIjmBEPTo3JVCjlPIEcwL8guTA jlRzsaCv/dcxncaQprYQ1s3KCgpN14mmAAQCRHeCU5lliOPuTtbSzFIWz0R5U9g8TDO8qitCI p1SRLdr0VofFQOgS60A3iZPdEbDjzHMMCFbB6ZmTtpY5i5F6q8OBV0z9vFLLaHJr3MuB0mvyE twwbz/YbRfpIunW04ZsL8hp1FWNyT24QyRFXPCrrp+6b5sQ9Qc6r5JT2U/grKwQzqu19J59 X-Spam-Score: -0.2 (/) X-Debbugs-Envelope-To: 28844 Cc: 28844@debbugs.gnu.org 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: -0.2 (/) >> =E2=80=98window-configuration-change-hook=E2=80=99 is still run way t= oo often, for >> example, when windows get resized. =E2=80=98window-size-change-funct= ions=E2=80=99 might >> be better. But if you need such a hook, wouldn't you also need it wh= en >> line numbers occupy more or less columns, for example, during scrolli= ng? >> >> Otherwise, why can't you use =E2=80=98display-line-numbers-mode-hook=E2= =80=99? > > Thanks for pointing me to display-line-numbers-mode-hook, but I=E2=80=99= ve > found that it=E2=80=99s not enough to just check when the mode is enab= led. We > need to alert other concerned modes whenever display-line-numbers-mode= > changes the margins, e.g. due to scrolling from line 99 to 100 (which > will increase the width from 2 to 3). That's what I meant when I said that "if you need such a hook, wouldn't you also need it when line numbers occupy more or less columns, for example, during scrolling?" You could use =E2=80=98window-scroll-functions=E2=80=99 (remembering the = old line number widths) for scrolling but this would not handle simple point movements. Eli will decide what to do. If an existing hook must be chosen, I'd rather (mis-)use =E2=80=98window-size-change-functions=E2=80=99 - strictl= y spoken, display of line numbers never affects the size of windows (something which is not true vice-versa IIUC). But better, provide a separate hook like =E2=80=98line-number-width-changed-functions=E2=80=99 with the corre= sponding window as argument (and maybe the old line number width as second). martin From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 15 09:27:56 2017 Received: (at 28844) by debbugs.gnu.org; 15 Oct 2017 13:27:56 +0000 Received: from localhost ([127.0.0.1]:41058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3ixQ-0004ae-Ef for submit@debbugs.gnu.org; Sun, 15 Oct 2017 09:27:56 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:44551) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3ixP-0004aW-1y for 28844@debbugs.gnu.org; Sun, 15 Oct 2017 09:27:55 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 2C6A620B0E; Sun, 15 Oct 2017 09:27:54 -0400 (EDT) Received: from web5 ([10.202.2.215]) by compute3.internal (MEProxy); Sun, 15 Oct 2017 09:27:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paulwrankin.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=w/kuXeHR1vOrPY5tm y1BzW/wJ0PQ5xZxY79/tL28F38=; b=TP/QevhRvHRQyupAtmWYQN8zVyqdCOA46 ePeybHWhStG803l3DwHUiIbwzO8NIuEOVgobhN4MVyM97it2U2PJDOpMhwGysCHa FsiTKq2z7EdPTuq9YeVEv50gFSpyKn6xcavBAhXeNjo+R3NYAfltXzgbQWmitmiL s4EL19Stqs6W7Yn4/J9zZ65atvhdmRcqyKFe/70rxfV0hCoEkX4r66CbEPG6ooYN kl9dpnA94mJvOuzM95wkiOR4PeoYbJp74qoXoq6049wk62f7MJp5YZ4nMZBNOOER dK9pSFsH4bWPUU81qrKqAQac8SOk8Em7FCNadHIn2QUdhZ7SFV4EQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=w/kuXe HR1vOrPY5tmy1BzW/wJ0PQ5xZxY79/tL28F38=; b=egGkxVB+oO0zfUVBj1OV5+ UWli4iKVpIbSFCifwgvFCnrv7YOOYIhB8Y8Vqpp23h7haTNqfBQEgT4WVxWtSwvB PnyW/sf1iP/kVRIVlJPsgUgzG5UeRHx8KIFc+JEEMO4i+c8tCLSMVfhM/DBrCWnu +x4PqITH5PA8GVhepwNf+il0QtvQ6DzqTKl9yi8Q+CKUkCJLIUS+zseaTvdsSRbu /F+UHd0yOLAddL8+NjiXdVc9FQ4ET7pOoKFgEUD5g5TpkCtAaGBLtcaT0mV/A0Im ye+P+g1jmQ+WllHZtTlXMLGF/pQVWIs9/9JRbyMgt3ENcsLu3I32MDnt70PsYWzg == X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 081B59E2EE; Sun, 15 Oct 2017 09:27:53 -0400 (EDT) Message-Id: <1508074073.3557079.1139314312.4BFE5BC2@webmail.messagingengine.com> From: Paul Rankin To: martin rudalics MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-26fdae60 Date: Sun, 15 Oct 2017 23:27:53 +1000 References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook In-Reply-To: <59E350AE.3060005@gmx.at> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 28844 Cc: 28844@debbugs.gnu.org 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: -0.7 (/) On Sun, 15 Oct 2017, at 10:12 PM, martin rudalics wrote: > > Thanks for pointing me to display-line-numbers-mode-hook, but I=E2=80= =99ve > > found that it=E2=80=99s not enough to just check when the mode is enab= led. We > > need to alert other concerned modes whenever display-line-numbers-mode > > changes the margins, e.g. due to scrolling from line 99 to 100 (which > > will increase the width from 2 to 3). >=20 > That's what I meant when I said that >=20 > "if you need such a hook, wouldn't you also need it when line numbers > occupy more or less columns, for example, during scrolling?=E2=80=9D Ah sorry Maritn. While trying the mode hook solution I forgot about your in= itial response! =20 > You could use =E2=80=98window-scroll-functions=E2=80=99 (remembering the = old line number > widths) for scrolling but this would not handle simple point movements. window-scroll-functions doesn=E2=80=99t quite cut it.... This is all I shou= ld have to do, where WINDOW is the selected window and MARGIN is an integer: - (set-window-margins window margin margin)) + (set-window-margins window (if (featurep 'display-line-numbers) + (- margin (line-number-display-width)) + margin) + margin)) > Eli will decide what to do. If an existing hook must be chosen, I'd > rather (mis-)use =E2=80=98window-size-change-functions=E2=80=99 - strictl= y spoken, > display of line numbers never affects the size of windows (something > which is not true vice-versa IIUC). But better, provide a separate hook > like =E2=80=98line-number-width-changed-functions=E2=80=99 with the corre= sponding window > as argument (and maybe the old line number width as second). Cool. As long as there is a hook. I appreciate inclusion of the function li= ne-number-display-width, but introducing compatibility-breaking code then p= utting the onus on others to work around it is kinda rude. If there is a pr= oper hook it eases the pain a bit. Think we can get this fixed before 26.1? I assume this might effect #28248 = too... From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 15 10:48:08 2017 Received: (at 28844) by debbugs.gnu.org; 15 Oct 2017 14:48:09 +0000 Received: from localhost ([127.0.0.1]:41766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3kD2-0000Fh-KJ for submit@debbugs.gnu.org; Sun, 15 Oct 2017 10:48:08 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56243) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3kD0-0000F5-7o for 28844@debbugs.gnu.org; Sun, 15 Oct 2017 10:48:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3kCq-0005BU-5R for 28844@debbugs.gnu.org; Sun, 15 Oct 2017 10:48:00 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3kCq-0005BI-1e; Sun, 15 Oct 2017 10:47:56 -0400 Received: from [176.228.60.248] (port=4632 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e3kCp-0007bp-Fp; Sun, 15 Oct 2017 10:47:55 -0400 Date: Sun, 15 Oct 2017 17:47:52 +0300 Message-Id: <83po9oh3hj.fsf@gnu.org> From: Eli Zaretskii To: martin rudalics In-reply-to: <59E350AE.3060005@gmx.at> (message from martin rudalics on Sun, 15 Oct 2017 14:12:30 +0200) Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28844 Cc: hello@paulwrankin.com, 28844@debbugs.gnu.org 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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Sun, 15 Oct 2017 14:12:30 +0200 > From: martin rudalics > Cc: 28844@debbugs.gnu.org > > You could use ‘window-scroll-functions’ (remembering the old line number > widths) for scrolling but this would not handle simple point movements. Simple point movements (for some value of "simple") don't affect the width used for line numbers. > Eli will decide what to do. I actually don't understand why a hook is needed. If a Lisp application wants/needs to be sensitive to the width of the line-number display, it should simply call line-number-display-width each time it needs to know the value. This function is guaranteed to return zero when display-line-numbers is nil, and it's also guaranteed (barring bugs ;-) to return the exact same value as what the display engine will use, provided that the window-start doesn't move between the call to line-number-display-width and when you need to use the value. So it will correctly reflect any changes in the width used for the line numbers. What am I missing? > If an existing hook must be chosen, I'd > rather (mis-)use ‘window-size-change-functions’ - strictly spoken, > display of line numbers never affects the size of windows (something > which is not true vice-versa IIUC). Precisely. Which IMO makes window-size-change-functions inappropriate for this purpose. > But better, provide a separate hook like > ‘line-number-width-changed-functions’ with the corresponding window > as argument (and maybe the old line number width as second). I have hard time imagining how to implement such a hook (or any hook which needs to be called "when the width changes"). You see, the display engine doesn't know that the width changed -- it computes the required width once, when it's about to redisplay a window, keeps the computed value only as long as it needs to display that window, and doesn't store it anywhere where it would survive until the next redisplay. So implementing such a hook would need some non-trivial changes, because the previous width will have to be stored in the window object, and we will need to manage that stored value (e.g., invalidate it when we switch buffers in a window). Moreover, hooks that are to be called by the display engine are usually a bad idea if they are to be used to affect redisplay, because they more often than not require an immediate additional cycle of redisplay, which makes Emacs sluggish. I provided the line-number-display-width function in the hope that it will serve any Lisp program that needs to be sensitive to the screen estate taken by line numbers. If it somehow doesn't fit this bill, please tell why, maybe it should be extended. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 15 10:59:20 2017 Received: (at 28844) by debbugs.gnu.org; 15 Oct 2017 14:59:20 +0000 Received: from localhost ([127.0.0.1]:41771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3kNr-0000WQ-PI for submit@debbugs.gnu.org; Sun, 15 Oct 2017 10:59:19 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57936) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3kNq-0000WE-Fz for 28844@debbugs.gnu.org; Sun, 15 Oct 2017 10:59:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3kNg-0005Wv-JR for 28844@debbugs.gnu.org; Sun, 15 Oct 2017 10:59:13 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38174) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3kNg-0005WS-Eu; Sun, 15 Oct 2017 10:59:08 -0400 Received: from [176.228.60.248] (port=4896 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e3kNf-00037Z-S4; Sun, 15 Oct 2017 10:59:08 -0400 Date: Sun, 15 Oct 2017 17:59:04 +0300 Message-Id: <83o9p8h2yv.fsf@gnu.org> From: Eli Zaretskii To: Paul Rankin In-reply-to: <1508074073.3557079.1139314312.4BFE5BC2@webmail.messagingengine.com> (message from Paul Rankin on Sun, 15 Oct 2017 23:27:53 +1000) Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> <1508074073.3557079.1139314312.4BFE5BC2@webmail.messagingengine.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28844 Cc: rudalics@gmx.at, 28844@debbugs.gnu.org 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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Paul Rankin > Date: Sun, 15 Oct 2017 23:27:53 +1000 > Cc: 28844@debbugs.gnu.org > > This is all I should have to do, where WINDOW is the selected window and MARGIN is an integer: > > - (set-window-margins window margin margin)) > + (set-window-margins window (if (featurep 'display-line-numbers) > + (- margin (line-number-display-width)) > + margin) > + margin)) Exactly. So why do you need a hook? Just call this every time you need the value, and you will have the up-to-date one. > Cool. As long as there is a hook. I appreciate inclusion of the function line-number-display-width, but introducing compatibility-breaking code then putting the onus on others to work around it is kinda rude. If there is a proper hook it eases the pain a bit. If that's the problem, then you could provide a wrapper around line-number-display-width for older versions of Emacs, which would always return zero for those versions. Or even explicitly check for display-line-numbers being nil, which it always will be in older versions, and return zero even without calling line-number-display-width. I believe this is the standard way of dealing with these problems. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 15 23:22:04 2017 Received: (at 28844) by debbugs.gnu.org; 16 Oct 2017 03:22:04 +0000 Received: from localhost ([127.0.0.1]:42247 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3vye-0001Nm-68 for submit@debbugs.gnu.org; Sun, 15 Oct 2017 23:22:04 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:46891) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3vyc-0001Ne-39 for 28844@debbugs.gnu.org; Sun, 15 Oct 2017 23:22:02 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id ABAB020B88; Sun, 15 Oct 2017 23:22:00 -0400 (EDT) Received: from web5 ([10.202.2.215]) by compute3.internal (MEProxy); Sun, 15 Oct 2017 23:22:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paulwrankin.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=7T5J3lcUZizQx3IEH jtR05cqzGrEKMmmnO14ZsSUt3A=; b=d6TqPtYafZUaVZVawDg/ymwRUZqHnunYV awVVcGdTUMDHU5qzO1DhtZT+ryEvV+/bA0OFYF1wSRAq9+iPBj4WgCx3cNcTzrDx /0MpWJS6kg4jULP4n4rFLKGR8d0QlDBwT+tDFdSvW/Ug6kYLTMZyqtzRLr1eyuIf CXrsumrXMWHLiHqdjCGrrEZpRIZ82iLc8ZKvZ+Vtl7NWyTKI6pggxTx1ffgaKNFE fRvCcSu3BMHbpkiLUe/JLRAhfiHaO7QmrMCxwIWGpw1QGr1jaBfK8mthOGJJG7on Z+8OG+v5aW2FDVJuigj60su4m3VTES24aMJ9PxEHa7li1/G7rVDTw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=7T5J3l cUZizQx3IEHjtR05cqzGrEKMmmnO14ZsSUt3A=; b=CgRFPqziR+qANBcbEzzCFX AJuhlPTGEnIMmiAY02ixhBEYDuLF1GQlpBVXJhk3CN0WUCUOq2xdz375wNiMiO0c LkSi6/WVPwzw2xoRFq3+44NQDUjZbczxqPxeeuiVv2QfY3I+nwUMmZ6z1VCyJh51 1RHDqLcK9SEg3fikOlgJhra/yEBlM8972Rhr5LhUzwzGX69nawGf7xJFv1I5ywqh +0GzbD3doXMwpqofS4u3URzh6TDbIR+MGdPLeeuIjxLmLLSeuHnUpWTph9sU1zav SRGG3S/ZBF9tYDYuc4InTH93Dyl+Kl+pwjYd570IVZtc6mCpQ/zYmnZDh4uvM8bw == X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 7AD619E302; Sun, 15 Oct 2017 23:22:00 -0400 (EDT) Message-Id: <1508124120.3709085.1139805520.1F653A1C@webmail.messagingengine.com> From: Paul Rankin To: Eli Zaretskii MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-26fdae60 Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook In-Reply-To: <83o9p8h2yv.fsf@gnu.org> References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> <1508074073.3557079.1139314312.4BFE5BC2@webmail.messagingengine.com> <83o9p8h2yv.fsf@gnu.org> Date: Mon, 16 Oct 2017 13:22:00 +1000 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 28844 Cc: rudalics@gmx.at, 28844@debbugs.gnu.org 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: -0.7 (/) On Mon, 16 Oct 2017, at 12:59 AM, Eli Zaretskii wrote: > > From: Paul Rankin > > Date: Sun, 15 Oct 2017 23:27:53 +1000 > > Cc: 28844@debbugs.gnu.org > >=20 > > This is all I should have to do, where WINDOW is the selected window an= d MARGIN is an integer: > >=20 > > - (set-window-margins window margin margin)) > > + (set-window-margins window (if (featurep 'display-line-numbers) > > + (- margin (line-number-display-wi= dth)) > > + margin) > > + margin)) >=20 > Exactly. So why do you need a hook? Just call this every time you > need the value, and you will have the up-to-date one. Because this doesn=E2=80=99t work. If it did I wouldn=E2=80=99t be posting = it. Think about it; your mode updates the display on its own without notify= ing Emacs. The basic conceptual problem is that =E2=80=9Cevery time you nee= d the value=E2=80=9D is predicated on when display-line-numbers-mode change= s the value. There=E2=80=99s no way for another lisp program to know when t= hat is. > > Cool. As long as there is a hook. I appreciate inclusion of the functio= n line-number-display-width, but introducing compatibility-breaking code th= en putting the onus on others to work around it is kinda rude. If there is = a proper hook it eases the pain a bit. >=20 > If that's the problem, then you could provide a wrapper around > line-number-display-width for older versions of Emacs, which would > always return zero for those versions. Or even explicitly check for > display-line-numbers being nil, which it always will be in older > versions, and return zero even without calling > line-number-display-width. I believe this is the standard way of > dealing with these problems. If you=E2=80=99ve introduced a problem into Emacs without the forethought o= n how it will adversely affect existing code, the onus is on you to either = remove or fix it. Function featurep is enough to know if display-line-numbe= rs is present (as above). From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 16 01:00:03 2017 Received: (at 28844) by debbugs.gnu.org; 16 Oct 2017 05:00:04 +0000 Received: from localhost ([127.0.0.1]:42297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3xVT-0003mu-Cn for submit@debbugs.gnu.org; Mon, 16 Oct 2017 01:00:03 -0400 Received: from mail-it0-f43.google.com ([209.85.214.43]:55701) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3xVR-0003lr-5C for 28844@debbugs.gnu.org; Mon, 16 Oct 2017 01:00:01 -0400 Received: by mail-it0-f43.google.com with SMTP id l196so16655346itl.4 for <28844@debbugs.gnu.org>; Sun, 15 Oct 2017 22:00:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=SMFJssIZXhLnm2b/SJ9txM3Xwe7fgdpMRHIK3zKr9RU=; b=YhSDFTGso8flW2FJbz0Awy6qmT3QmdGjZ7hqx+nmo9NYeADyQmkvTlexu1MaK6fo+D 1dml7L4fVrf6eFv/SRiq5HDJXch86zWXDupHZr+7BJm1WlQm7QIlj9drTe6ueFLdDojs Pmg6HLpWMDdaIt98hCmsx4FC7DviRMrKtqAjMEQjYX4a/KK6xTb3HtWZbRzNRBvW8ibR kA544h9Noi76EKb3DYnbZ4CC/qyEeX6L3K+gtRdCfkXaNXT0WjgxrIepW1Fto/ZwuuVU HWYm9J2UT+upQDqFHrUm1vDOdJJYgXOYT4CcPfAZrjiidw1cFW1sIEXt/rAsd2BcORbB 5ZiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=SMFJssIZXhLnm2b/SJ9txM3Xwe7fgdpMRHIK3zKr9RU=; b=sEW3PVdCaGriXqpl686CgqFqfC7YKoK1GXfgyszbEjVdqCkJYvkKP6eVFaxQ5JUZPv ndl2bdEf4ge+B8qsRlGQg3MtgcgwRlZ9H38qYPK+r4jJ3eJIzTDYmnHo25XFwnznnTxL AUoTYfkSPuoSgoo0BeMplDZlxZ9BF9YYOeUnKarcXTCWTuRCnsHcyoHfhzFT4W9us298 q98WFCq/kqemUorXp+5/YHY0wqpBsqIXfRbOfL9bK7VtCL3/TqwBF39O61qIO8l49hGP 7OPmH+Lw29s676rPKvnBioMB0FHoHatpw4Wg3zsmA/7mXvbJNUsQj5+C5jQhpki4n6Rt Mntg== X-Gm-Message-State: AMCzsaU5kUW7NdfLRKPxEhR6vld4Bd4ghiGnsfhaj2n9WCv1xaigj1c0 P3AB8mZe5V4XW6CYveVcIX+BBA== X-Google-Smtp-Source: ABhQp+QSCAiavDyAHOC4TPeydD86q3ggTzi2DuCi98TiIbImPDH4Q9sgH4PdN2ZBJUSMNvCvHYglfQ== X-Received: by 10.36.34.11 with SMTP id o11mr12386160ito.70.1508129995111; Sun, 15 Oct 2017 21:59:55 -0700 (PDT) Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) by smtp.gmail.com with ESMTPSA id b190sm3126771ioe.1.2017.10.15.21.59.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 15 Oct 2017 21:59:54 -0700 (PDT) From: Alex To: Paul Rankin Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> <1508074073.3557079.1139314312.4BFE5BC2@webmail.messagingengine.com> <83o9p8h2yv.fsf@gnu.org> <1508124120.3709085.1139805520.1F653A1C@webmail.messagingengine.com> Date: Sun, 15 Oct 2017 22:59:35 -0600 In-Reply-To: <1508124120.3709085.1139805520.1F653A1C@webmail.messagingengine.com> (Paul Rankin's message of "Mon, 16 Oct 2017 13:22:00 +1000") Message-ID: <87efq37knc.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 28844 Cc: Eli Zaretskii , 28844@debbugs.gnu.org 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: 0.5 (/) Paul Rankin writes: > Because this doesn=E2=80=99t work. If it did I wouldn=E2=80=99t be postin= g it. Think about it; > your mode updates the display on its own without notifying Emacs. The bas= ic > conceptual problem is that =E2=80=9Cevery time you need the value=E2=80= =9D is predicated on when > display-line-numbers-mode changes the value. There=E2=80=99s no way for a= nother lisp > program to know when that is. I agree that Emacs should present a way to specify width that automatically takes line numbers into account. > Function featurep is enough to know if display-line-numbers is present (as > above). Actually, I'd recommend (boundp 'display-line-numbers), since the feature `display-line-numbers' isn't loaded automatically in Emacs. It should be noted that `display-line-numbers-mode' is just a minor mode wrapper around the variable `display-line-numbers', which actually does the work. This also means that the hook `display-line-numbers-hook' isn't actually enough to determine whether or not line numbers have been toggled (since one can just toggle the variable instead). I'd say its main use is in user configurations. To see if line numbers are present in a buffer (and to make it compatible with older Emacsen), you should use something like: (bound-and-true-p display-line-numbers) From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 16 01:14:13 2017 Received: (at 28844) by debbugs.gnu.org; 16 Oct 2017 05:14:13 +0000 Received: from localhost ([127.0.0.1]:42316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3xjA-0004GB-WC for submit@debbugs.gnu.org; Mon, 16 Oct 2017 01:14:13 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:56905) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3xj9-0004G1-Er for 28844@debbugs.gnu.org; Mon, 16 Oct 2017 01:14:11 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id C5A9920BBB; Mon, 16 Oct 2017 01:14:10 -0400 (EDT) Received: from web5 ([10.202.2.215]) by compute3.internal (MEProxy); Mon, 16 Oct 2017 01:14:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paulwrankin.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=5D0YB4UPEUsp0f94U uhlnR96O7seGIxfHJxrNaPWWMg=; b=dOu7X+DHaZK7TXjMRHMFpQkdBq56dHjVC O3oYP2K/BCcDA6xb3B1tjjGXEA1Whg7G4u2IN+KtkErNeIL03Arqkgat1xDA4UFj Cej5rOWbmN+0qTpF/MkPlcTGh/h7S8KBwoRqkfV78/CAmsOF7wjnCwdK/scTtWxY mualJprKY+h2hL1oaCHvwnYU8Vg1NP4/XW17+LQHhbyQFuCnYAQ6zsYEGwXLnzLL bZ/SyfKUzORq+J7h1jysXVpbN2CIM8Z1Os1e6aBHGEFMA20wu8y58G3iFWYoL+tx 3artRj12b9W+3ByRXiC0HT9J9xmqSOuxbfFhZkZgU0RLB4anJ0RkA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=5D0YB4 UPEUsp0f94UuhlnR96O7seGIxfHJxrNaPWWMg=; b=CQPb9ozcO/bvZ05Ga1lsPQ QSHmjtWswvf7vtT5IHceEn6CotyDR802a6E+6OubhQOiww70EpudJZLMrId8rQY9 nBNnQMl316Zy5kEQNk4f8Ec+IxsVVyGlUuf3Gq/GhKjypCiW+S3xDKMMvHOzMxGa lnTV4/HGbMLiJ+USVtR+vPV8cKc5ySKNeIb9uydn5np8Gn7OPRUHb8fZ3SMOfXOY nS724jgPb7EkU03ZK5UtZyVPl1rTTUWvd8gfTGApx10z1jUiaI4HMhhJSTg2OHvI NiSd4l4SQbAdrtmQiUyQBZVCJFR7GRJqKssz3UlLkfFN87e72Z7Pqm3j2Yd1FBQg == X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 8A7BD9E2FE; Mon, 16 Oct 2017 01:14:10 -0400 (EDT) Message-Id: <1508130850.3734431.1139876192.21CE8281@webmail.messagingengine.com> From: Paul Rankin To: Alex MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-26fdae60 Date: Mon, 16 Oct 2017 15:14:10 +1000 References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> <1508074073.3557079.1139314312.4BFE5BC2@webmail.messagingengine.com> <83o9p8h2yv.fsf@gnu.org> <1508124120.3709085.1139805520.1F653A1C@webmail.messagingengine.com> <87efq37knc.fsf@gmail.com> Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook In-Reply-To: <87efq37knc.fsf@gmail.com> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 28844 Cc: Eli Zaretskii , 28844@debbugs.gnu.org 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: -0.7 (/) On Mon, 16 Oct 2017, at 02:59 PM, Alex wrote: > Actually, I'd recommend (boundp 'display-line-numbers), since the > feature `display-line-numbers' isn't loaded automatically in Emacs. It > should be noted that `display-line-numbers-mode' is just a minor mode > wrapper around the variable `display-line-numbers', which actually does > the work. >=20 > This also means that the hook `display-line-numbers-hook' isn't actually > enough to determine whether or not line numbers have been toggled (since > one can just toggle the variable instead). I'd say its main use is in > user configurations. >=20 > To see if line numbers are present in a buffer (and to make it > compatible with older Emacsen), you should use something like: >=20 > (bound-and-true-p display-line-numbers) Sweet, thanks! I=E2=80=99ve encountered another bug with this mode #28855, = so I think until it gets its house in order, the best thing to go with is: (if (bound-and-true-p display-line-numbers) (display-line-numbers-mode 0)) I=E2=80=99ve just discovered that linum-mode.el has been fixed to respect e= xisting margins, so big love & thanks to whoever did that work. So, if linu= m-mode can be a good lisp citizen, so too can display-line-numbers-mode! From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 16 03:42:07 2017 Received: (at 28844) by debbugs.gnu.org; 16 Oct 2017 07:42:07 +0000 Received: from localhost ([127.0.0.1]:42417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e402I-0007sr-QE for submit@debbugs.gnu.org; Mon, 16 Oct 2017 03:42:06 -0400 Received: from mout.gmx.net ([212.227.17.21]:64512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e402H-0007sO-Es for 28844@debbugs.gnu.org; Mon, 16 Oct 2017 03:42:06 -0400 Received: from [192.168.1.100] ([46.125.249.64]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LabZr-1dO2ea3qCF-00mNne; Mon, 16 Oct 2017 09:41:56 +0200 Message-ID: <59E462BE.1040101@gmx.at> Date: Mon, 16 Oct 2017 09:41:50 +0200 From: martin rudalics MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> <83po9oh3hj.fsf@gnu.org> In-Reply-To: <83po9oh3hj.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:ueJPxoqu8aEvPqykuhLPaHQqWOg7J/AKFhid6sEnru9fieTiKeQ g7DzhmfeppzNxmY8ULpQiRPPiI0hHzbeyqTQY17qeXOUtsdaFDdT/8hGQxisQQz+dB8NQCW X63dbBnAcRxwoNDVYHjXfqu7LkTqdAEyKk3Mq+ZiUr6dSCegionmfrtbsRYgD5S+AsM0FBZ yOvL9TFb8owluV3u2n67g== X-UI-Out-Filterresults: notjunk:1;V01:K0:/K0U7hmxYIU=:7fNGSpuygaBG+9B6hlkyy0 Z9pCii8G3z26YPptIb1PiFGXGRH8nt1mTBEpeMsb5OI64AEXcuzUxkbbbb4XzJRFLjK/yL3xS qWwHkNxVfgg+HnP/08xVLHS3vPFgrLhqkiHcmbBBWsqP+6hk0o4dpay9pTJ5BJyZofgtu27R6 Kvo7mCoR8uvGYBA0PHtz1NXOyRhI5TMrBxEQQ8FuSOis0v3wPTeEyGM+0PbbAdQUY6LIt1MPK at/jCUmyvbJHvdDqZh/gfZfiirxNL3qJ5P3w9IBfgRxKjWxfaf5NC95HhNMIlTDvOSRXhQnpp Lre3Ftl+XIjio5KLNvUCNSL17sj2CGc6cbFwcUymeMzovkkNqNgpgi/YLaTXYLE1+B4b/RGbH BevtAOGC4c4KI8iJuVyx3sCj2WBpPDbWOXaRCNX/bYvHSWyerAsrWMSWRiLee8LozM3CEpJvI FcTML+8g/Piay7a0uUa5alrJ+KzkOsIAINtVobTlFkPLDSIWADbyG3FEvba3dKR3bXlRhxSFR qb0exRQ9IN4Jd1sooWo6RosJ23zbLvZTAaVRa0bVC6416AFq9c/YWa89xu/vEA9YCHPLiPn7B nbW0uuBxoG+kbgOjG/3TgfIbMcud7mXw48HyuoWd+2qgiTb2W6lQJ7wG4pEsHuGczd+sptHRb jML8PXTMy9Ah6nVytD05cMe+FogthtKUYypQ0nPwWqjGEG+I/ix7/WNFozYJiw5hbD87Jhr5X mP88ejvd0oYw+UH/BKIWZWPKoTlbIe6GYMAHooIQUGI1hf9ModRjTf8grtzatfSutAHfNdmhv oTxK0URWqXhacaLSV1UJE5n8jmqBwb/F1CoybsTimfGn0abPk8gbZydJD3B6BTnep37VzQP X-Spam-Score: -0.2 (/) X-Debbugs-Envelope-To: 28844 Cc: hello@paulwrankin.com, 28844@debbugs.gnu.org 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: -0.2 (/) > Simple point movements (for some value of "simple") don't affect the > width used for line numbers. Yes. I forgot that this will affect the window start position as well in all cases the OP could be interested in. > I actually don't understand why a hook is needed. If a Lisp > application wants/needs to be sensitive to the width of the > line-number display, it should simply call line-number-display-width > each time it needs to know the value. This function is guaranteed to > return zero when display-line-numbers is nil, and it's also guaranteed > (barring bugs ;-) to return the exact same value as what the display > engine will use, provided that the window-start doesn't move between > the call to line-number-display-width and when you need to use the > value. So it will correctly reflect any changes in the width used for > the line numbers. > > What am I missing? Probably nothing. IIUC your code also handles adding/removing text that would increase/decrease the line numbers width while leaving the window start position alone. martin From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 16 10:49:26 2017 Received: (at 28844) by debbugs.gnu.org; 16 Oct 2017 14:49:27 +0000 Received: from localhost ([127.0.0.1]:43962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e46hq-00013U-Mp for submit@debbugs.gnu.org; Mon, 16 Oct 2017 10:49:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36413) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e46ho-00013G-GH for 28844@debbugs.gnu.org; Mon, 16 Oct 2017 10:49:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e46hW-00039t-MP for 28844@debbugs.gnu.org; Mon, 16 Oct 2017 10:49:19 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55231) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e46hW-00039P-3U; Mon, 16 Oct 2017 10:49:06 -0400 Received: from [176.228.60.248] (port=1916 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e46hV-0001cB-Jd; Mon, 16 Oct 2017 10:49:05 -0400 Date: Mon, 16 Oct 2017 17:48:50 +0300 Message-Id: <83zi8rf8rx.fsf@gnu.org> From: Eli Zaretskii To: Paul Rankin In-reply-to: <1508130850.3734431.1139876192.21CE8281@webmail.messagingengine.com> (message from Paul Rankin on Mon, 16 Oct 2017 15:14:10 +1000) Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> <1508074073.3557079.1139314312.4BFE5BC2@webmail.messagingengine.com> <83o9p8h2yv.fsf@gnu.org> <1508124120.3709085.1139805520.1F653A1C@webmail.messagingengine.com> <87efq37knc.fsf@gmail.com> <1508130850.3734431.1139876192.21CE8281@webmail.messagingengine.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28844 Cc: 28844@debbugs.gnu.org, agrambot@gmail.com 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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Paul Rankin > Cc: Eli Zaretskii , 28844@debbugs.gnu.org > Date: Mon, 16 Oct 2017 15:14:10 +1000 > > > To see if line numbers are present in a buffer (and to make it > > compatible with older Emacsen), you should use something like: > > > > (bound-and-true-p display-line-numbers) Indeed, if the problem is with determining whether line-number-display-width should be called, then bound-and-true-p is the way. Sorry I didn't realize this was the issue. > Sweet, thanks! I’ve encountered another bug with this mode #28855, so I think until it gets its house in order, the best thing to go with is: > (if (bound-and-true-p display-line-numbers) (display-line-numbers-mode 0)) So does this mean the issue in this bug report (which AFAIU was how to set the window's display margins in a way that is sensitive to display-line-numbers-mode) is resolved for you? Or is there anything else to be done about this? (Bug#28855 is a separate issue, I will respond to that there.) Thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 16 20:35:59 2017 Received: (at 28844) by debbugs.gnu.org; 17 Oct 2017 00:35:59 +0000 Received: from localhost ([127.0.0.1]:44488 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4FrT-0006P5-FW for submit@debbugs.gnu.org; Mon, 16 Oct 2017 20:35:59 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:45957) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4FrR-0006Ox-W8 for 28844@debbugs.gnu.org; Mon, 16 Oct 2017 20:35:58 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 909E320C0D; Mon, 16 Oct 2017 20:35:57 -0400 (EDT) Received: from web5 ([10.202.2.215]) by compute3.internal (MEProxy); Mon, 16 Oct 2017 20:35:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paulwrankin.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=NgOgTLlDlW5uz3e/U bnpgl0IANf+J6NEwZOfqxVhKxI=; b=2Q+vkbG/I5ktflN3P+qWck177FryXlLel aNtpPMwbZ8LGMnOTsp/S38HIXzVV6fzLbgrqf7v5Y1vekWmWiTsqMJrweN3hF6IO GmmroPcUng/jc1+RJ0cxYfB6yG2MFBuRU8LbtJAePiKChkAVCGpa+vVwa6RjNFdl TIm5wIhKerG5xEOreHPIjI3TUlMudRvlbgytUXhXXEr+LYdUZOgiAY6kMsCVhkqc yOLh5bpJ8paza9YQqHiU4Y22b8ins2otieFxIZXWmhC8ZYyvET/P8y3i+sIdtt1x EW/02/3SKLRCF/V+vLb8bLRLoO9VYosho0JbuQTyEtM27FmwMT+gg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=NgOgTL lDlW5uz3e/Ubnpgl0IANf+J6NEwZOfqxVhKxI=; b=dusYJLGguoIGNmYIDt99J3 oj7VQFduqxNLBtFP5xq3zL+wD/0tJU0JuvSI4O8+tjqER06QWUpPhIBvcDswVEiq qeE9LXij4r44QEuV2iGqWL6Fap/5YRLAokt5U9TQ9OhrBZEsM4MAxzxgxdmMsDc0 1IXcq1KeIfnxcBeiH7+UM53ewMGq17Mk0C7DDLRdIVHeTbF6lSG7Vh0GLVFDQMs2 f8IV5ToHN83RJQ+TqG7n3w+V9Y+G7CYUQJY+ADgZ0J8nMrpvbEk22gNNQ87RYGad UbsZPwzScPFKrisY1aZ84ZdZDYd339pmc5dcqe/u763JzAiOjftGaPim1DOEW/4g == X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 6B0D69E303; Mon, 16 Oct 2017 20:35:57 -0400 (EDT) Message-Id: <1508200557.2705080.1141019864.6A2B8BD5@webmail.messagingengine.com> From: Paul Rankin To: Eli Zaretskii MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-26fdae60 Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook In-Reply-To: <83zi8rf8rx.fsf@gnu.org> Date: Tue, 17 Oct 2017 10:35:57 +1000 References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> <1508074073.3557079.1139314312.4BFE5BC2@webmail.messagingengine.com> <83o9p8h2yv.fsf@gnu.org> <1508124120.3709085.1139805520.1F653A1C@webmail.messagingengine.com> <87efq37knc.fsf@gmail.com> <1508130850.3734431.1139876192.21CE8281@webmail.messagingengine.com> <83zi8rf8rx.fsf@gnu.org> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 28844 Cc: 28844@debbugs.gnu.org, agrambot@gmail.com 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: -0.7 (/) On Tue, 17 Oct 2017, at 12:48 AM, Eli Zaretskii wrote: > > From: Paul Rankin > > Cc: Eli Zaretskii , 28844@debbugs.gnu.org > > Date: Mon, 16 Oct 2017 15:14:10 +1000 > >=20 > > > To see if line numbers are present in a buffer (and to make it > > > compatible with older Emacsen), you should use something like: > > >=20 > > > (bound-and-true-p display-line-numbers) >=20 > Indeed, if the problem is with determining whether > line-number-display-width should be called, then bound-and-true-p is > the way. Sorry I didn't realize this was the issue. >=20 > > Sweet, thanks! I=E2=80=99ve encountered another bug with this mode #288= 55, so I think until it gets its house in order, the best thing to go with = is: > > (if (bound-and-true-p display-line-numbers) (display-line-numbers-mode = 0)) >=20 > So does this mean the issue in this bug report (which AFAIU was how to > set the window's display margins in a way that is sensitive to > display-line-numbers-mode) is resolved for you? Or is there anything > else to be done about this? (Bug#28855 is a separate issue, I will > respond to that there.) Your mode updates the display on its own without notifying Emacs. The basic= conceptual problem is that =E2=80=9Cevery time you need the value=E2=80=9D= is predicated on when display-line-numbers-mode changes the value. There= =E2=80=99s no way for another lisp program to know when that is. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 16 22:42:25 2017 Received: (at 28844) by debbugs.gnu.org; 17 Oct 2017 02:42:25 +0000 Received: from localhost ([127.0.0.1]:44549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4Hpo-0000v0-TG for submit@debbugs.gnu.org; Mon, 16 Oct 2017 22:42:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46121) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4Hpn-0000ul-71 for 28844@debbugs.gnu.org; Mon, 16 Oct 2017 22:42:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4Hpe-0007UF-Sj for 28844@debbugs.gnu.org; Mon, 16 Oct 2017 22:42:18 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4Hpe-0007UA-Op; Mon, 16 Oct 2017 22:42:14 -0400 Received: from [176.228.60.248] (port=2522 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e4Hpe-0003af-03; Mon, 16 Oct 2017 22:42:14 -0400 Date: Tue, 17 Oct 2017 05:41:56 +0300 Message-Id: <83bml6fqbv.fsf@gnu.org> From: Eli Zaretskii To: Paul Rankin In-reply-to: <1508200557.2705080.1141019864.6A2B8BD5@webmail.messagingengine.com> (message from Paul Rankin on Tue, 17 Oct 2017 10:35:57 +1000) Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> <1508074073.3557079.1139314312.4BFE5BC2@webmail.messagingengine.com> <83o9p8h2yv.fsf@gnu.org> <1508124120.3709085.1139805520.1F653A1C@webmail.messagingengine.com> <87efq37knc.fsf@gmail.com> <1508130850.3734431.1139876192.21CE8281@webmail.messagingengine.com> <83zi8rf8rx.fsf@gnu.org> <1508200557.2705080.1141019864.6A2B8BD5@webmail.messagingengine.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28844 Cc: 28844@debbugs.gnu.org, agrambot@gmail.com 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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Paul Rankin > Cc: agrambot@gmail.com, 28844@debbugs.gnu.org > Date: Tue, 17 Oct 2017 10:35:57 +1000 > > Your mode updates the display on its own without notifying Emacs. The basic conceptual problem is that “every time you need the value” is predicated on when display-line-numbers-mode changes the value. There’s no way for another lisp program to know when that is. But if you always call line-number-display-width, you don't need to know that, because that function will return the current value (which will change to reflect the changes in the space taken by line numbers). So I don't think I understand the problem, and without that I cannot think of a solution. Can you clarify the problem, please? From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 00:19:18 2017 Received: (at 28844) by debbugs.gnu.org; 17 Oct 2017 04:19:18 +0000 Received: from localhost ([127.0.0.1]:44597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4JLa-0003A7-2X for submit@debbugs.gnu.org; Tue, 17 Oct 2017 00:19:18 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:37155) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4JLY-00039y-LP for 28844@debbugs.gnu.org; Tue, 17 Oct 2017 00:19:16 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id B04A420BBE; Tue, 17 Oct 2017 00:19:14 -0400 (EDT) Received: from web1 ([10.202.2.211]) by compute3.internal (MEProxy); Tue, 17 Oct 2017 00:19:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paulwrankin.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=CmgscqKkv+4bH3zwR WloW+GBBHeJBY7AIuJq3V9ezdo=; b=FZ9syuVSCmf/VO8KPESdmEUyOun9LT/kH hYqv8lpFCaQvWHb3dYLPTjqD30Yi9Fq3aqsNIr4dgLNimQFQgmn9hRr3V1e4C0NB x1MXBXpoL3YOa0DUGQUBqZRUFJnBDTAeeFqnuFUvdts2aCjgVB6RjxZoHxmFCsSz EdpCXONtz0zz8Gnh4t7nT5BRxWKzQtBugItepbkenr1N4Gg0MHMYC+D5aY60fx6U mKS1cuYZapZHQOvY0zihWN0IEPVUhgnwa5GyxB29tEFKbDxL3mGLNIEXhSyd1nXb HqSTlZZvBczm9Cop2SEJ+YLiJ0cZ+XyaZnnK9IEHn1WunU/mYp3lQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Cmgscq Kkv+4bH3zwRWloW+GBBHeJBY7AIuJq3V9ezdo=; b=lsNnk+t7uc+1kZaeDausvg vaeP52YKReaX59yEpodk6+kCO3kPKasYYNSQmtOkMzG7ftkK46fWE6cHTKydTez0 fhphaOTiAbRiGPHbKSeJMqwGMJyBm6Xu0i+8mu6MHBh084C7nomSpC9QVLLaDMq6 37r5DNhW885hSyuEdMEbkTd1/BfmCF7l3nuqpAAZggerhUxr5QrRFWIG0O6RUDSm hM2BbZDz09u3BlB0CwVXC/bsKsIdzdeK12Cn/AaUAriTJ5no9zVpKMmtpcg3SoBs jNzYmgax5wMGJj9Ojtf5cdOIU+PwptnbYa5mu1e0TcIA3huzBIah34JIm7AMzgYA == X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 8489A95784; Tue, 17 Oct 2017 00:19:14 -0400 (EDT) Message-Id: <1508213954.647567.1141167720.1CC00459@webmail.messagingengine.com> From: Paul Rankin To: Eli Zaretskii MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-26fdae60 References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> <1508074073.3557079.1139314312.4BFE5BC2@webmail.messagingengine.com> <83o9p8h2yv.fsf@gnu.org> <1508124120.3709085.1139805520.1F653A1C@webmail.messagingengine.com> <87efq37knc.fsf@gmail.com> <1508130850.3734431.1139876192.21CE8281@webmail.messagingengine.com> <83zi8rf8rx.fsf@gnu.org> <1508200557.2705080.1141019864.6A2B8BD5@webmail.messagingengine.com> <83bml6fqbv.fsf@gnu.org> Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook In-Reply-To: <83bml6fqbv.fsf@gnu.org> Date: Tue, 17 Oct 2017 14:19:14 +1000 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 28844 Cc: 28844@debbugs.gnu.org, agrambot@gmail.com 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: -0.7 (/) On Tue, 17 Oct 2017, at 12:41 PM, Eli Zaretskii wrote: > > Your mode updates the display on its own without notifying Emacs. The b= asic conceptual problem is that =E2=80=9Cevery time you need the value=E2= =80=9D is predicated on when display-line-numbers-mode changes the value. T= here=E2=80=99s no way for another lisp program to know when that is. >=20 > But if you always call line-number-display-width, you don't need to > know that, because that function will return the current value (which > will change to reflect the changes in the space taken by line > numbers). >=20 > So I don't think I understand the problem, and without that I cannot > think of a solution. Can you clarify the problem, please? Eli, you=E2=80=99re fundamentally misunderstanding something: 1. Your mode updates the display. 2. Another lisp program does not know your mode has updated the display. 3. Therefore, the lisp program will not know to call line-number-display-wi= dth. Your suggestion that other modes should =E2=80=9Calways=E2=80=9D call line-= number-display-width is what... to run an infinite loop waiting for your m= ode to furtively update the display and catch it then? From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 01:44:31 2017 Received: (at 28844) by debbugs.gnu.org; 17 Oct 2017 05:44:31 +0000 Received: from localhost ([127.0.0.1]:44633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4Kg3-0005KD-1d for submit@debbugs.gnu.org; Tue, 17 Oct 2017 01:44:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48933) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4Kg2-0005K1-7a for 28844@debbugs.gnu.org; Tue, 17 Oct 2017 01:44:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4Kft-0004NQ-SL for 28844@debbugs.gnu.org; Tue, 17 Oct 2017 01:44:25 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4Kfi-0004Er-Ja; Tue, 17 Oct 2017 01:44:10 -0400 Received: from [176.13.228.183] (port=23269 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 1e4Kfh-0001SY-Kk; Tue, 17 Oct 2017 01:44:10 -0400 Date: Tue, 17 Oct 2017 08:44:06 +0300 User-Agent: K-9 Mail for Android In-Reply-To: <1508213954.647567.1141167720.1CC00459@webmail.messagingengine.com> References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> <1508074073.3557079.1139314312.4BFE5BC2@webmail.messagingengine.com> <83o9p8h2yv.fsf@gnu.org> <1508124120.3709085.1139805520.1F653A1C@webmail.messagingengine.com> <87efq37knc.fsf@gmail.com> <1508130850.3734431.1139876192.21CE8281@webmail.messagingengine.com> <83zi8rf8rx.fsf@gnu.org> <1508200557.2705080.1141019864.6A2B8BD5@webmail.messagingengine.com> <83bml6fqbv.fsf@gnu.org> <1508213954.647567.1141167720.1CC00459@webmail.messagingengine.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook To: Paul Rankin From: Eli Zaretskii Message-ID: <06925BCF-6C99-423B-AB13-E7331E22B867@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28844 Cc: 28844@debbugs.gnu.org, agrambot@gmail.com 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: -5.0 (-----) On October 17, 2017 7:19:14 AM GMT+03:00, Paul Rankin wrote: > On Tue, 17 Oct 2017, at 12:41 PM, Eli Zaretskii wrote: > > > Your mode updates the display on its own without notifying Emacs=2E > The basic conceptual problem is that =E2=80=9Cevery time you need the va= lue=E2=80=9D > is predicated on when display-line-numbers-mode changes the value=2E > There=E2=80=99s no way for another lisp program to know when that is=2E > >=20 > > But if you always call line-number-display-width, you don't need to > > know that, because that function will return the current value > (which > > will change to reflect the changes in the space taken by line > > numbers)=2E > >=20 > > So I don't think I understand the problem, and without that I cannot > > think of a solution=2E Can you clarify the problem, please? >=20 > Eli, you=E2=80=99re fundamentally misunderstanding something: >=20 > 1=2E Your mode updates the display=2E >=20 > 2=2E Another lisp program does not know your mode has updated the > display=2E >=20 > 3=2E Therefore, the lisp program will not know to call > line-number-display-width=2E >=20 > Your suggestion that other modes should =E2=80=9Calways=E2=80=9D call > line-number-display-width is what=2E=2E=2E to run an infinite loop wait= ing > for your mode to furtively update the display and catch it then? First, let's be clear about something: it's not "my" mode=2E I'll never u= se it, except for testing and fixing bugs=2E I implemented this feature because line nu= mbers are very popular among Emacs users, and existing solutions, like linum-mode, s= low down Emacs, sometimes to a crawl=2E The excitement expressed by users on = Reddit when the feature landed, which surprised me, is a clear evidence that the = results are very satisfactory, as far as users are concerned=2E So this feature is here to stay, and Lisp packages need to adapt (bundled packages already did, AFAIK= )=2E Next, I *know* that I'm misunderstanding something, but repeating what you already said, twice, won't help me understand it=2E Please provide more details about your application's needs regarding the window layout=2E Given the little that you said until now, would checking the value returne= d by line-number-display-width in a post-command-hook solve your problem? If not, please tell why not, and let's take it from there=2E Thanks=2E From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 03:13:48 2017 Received: (at 28844) by debbugs.gnu.org; 17 Oct 2017 07:13:48 +0000 Received: from localhost ([127.0.0.1]:44702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4M4S-0007Po-AW for submit@debbugs.gnu.org; Tue, 17 Oct 2017 03:13:48 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:43129) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4M4Q-0007Pg-Vl for 28844@debbugs.gnu.org; Tue, 17 Oct 2017 03:13:47 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 9C8BE20CBE; Tue, 17 Oct 2017 03:13:46 -0400 (EDT) Received: from web5 ([10.202.2.215]) by compute3.internal (MEProxy); Tue, 17 Oct 2017 03:13:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paulwrankin.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=MwyGW/HR82Niba7JN fTCY9BcaBaefPc2ek04uJiBvDo=; b=FpOPO7MUv9K9B2BqL0Lxn3971FJfzGd09 0yS4Fhw1e47WniDof5l6HldG8bkaQx3FEKBnGev1R315XxJU2TM1cjm0z0S8wwSq ge7YSkNlUB4y3eRDCBOGSA2xMXatyL/lZxr2RKMm/IqY2P4DaJ0bmgKm8h82wIH6 uBAfUjCzXR1Bg838/u8cL0j4TT+iVS+FJFhQHxH4AwaTqZIrWc6rUzZmGV6HsP2T QuSDXPxSaPR2OBFwr+NMf4J4RWsYd0jeZ6voSJRUeTzIAwNYmcYv21L8Fer2FqBB bYgxLdt7JNQSV2U4fwv8MgH6c+dEcKbp77Lfxoche2LIlZZBcO6jw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=MwyGW/ HR82Niba7JNfTCY9BcaBaefPc2ek04uJiBvDo=; b=fqbtjXE5VsFAK1OEKlncD8 Jj/fV1FAp+YVtivg+NuuYMkMLg9eX43l/u2xhRmZXTzQ8Ervqaxuy1xQyUEue3ip Tcj2almKzwiH2aQyR3WEwD4eX3nRDwF1KLbkfSMAZ0DlMwQVXz4h4twpucJuAMcm Qd6pKDnEUiHGVXUk7uzMOFEvUEEtOoDk2hlo7bMki15+yTq6HUjIK+v8ihTJrOv9 sPVPvJyz8IqkGmShAXQRGH830QK6NliqYd31Wb30pAvYXu/xn15QVgMOTUrK2PdN 0kRL4lVimv+UcGzBlgnuDRWE22RkxyM15h+jt5nUKjjoJqaNqvH4VnEetAYmOSTw == X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 760FB9E2F3; Tue, 17 Oct 2017 03:13:46 -0400 (EDT) Message-Id: <1508224426.2790345.1141279648.61B955E6@webmail.messagingengine.com> From: Paul Rankin To: Eli Zaretskii MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-26fdae60 In-Reply-To: <06925BCF-6C99-423B-AB13-E7331E22B867@gnu.org> Date: Tue, 17 Oct 2017 17:13:46 +1000 Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> <1508074073.3557079.1139314312.4BFE5BC2@webmail.messagingengine.com> <83o9p8h2yv.fsf@gnu.org> <1508124120.3709085.1139805520.1F653A1C@webmail.messagingengine.com> <87efq37knc.fsf@gmail.com> <1508130850.3734431.1139876192.21CE8281@webmail.messagingengine.com> <83zi8rf8rx.fsf@gnu.org> <1508200557.2705080.1141019864.6A2B8BD5@webmail.messagingengine.com> <83bml6fqbv.fsf@gnu.org> <1508213954.647567.1141167720.1CC00459@webmail.messagingengine.com> <06925BCF-6C99-423B-AB13-E7331E22B867@gnu.org> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 28844 Cc: 28844@debbugs.gnu.org, agrambot@gmail.com 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: -0.7 (/) On Tue, 17 Oct 2017, at 03:44 PM, Eli Zaretskii wrote: > First, let's be clear about something: it's not "my" mode. I'll never us= e it, except > for testing and fixing bugs. I implemented this feature because line num= bers are > very popular among Emacs users, and existing solutions, like linum-mode, = slow > down Emacs, sometimes to a crawl. The excitement expressed by users on R= eddit > when the feature landed, which surprised me, is a clear evidence that the= results > are very satisfactory, as far as users are > concerned. So this feature is here to > stay, and Lisp packages need to adapt (bundled packages already did, AFAI= K). >=20 > Next, I *know* that I'm misunderstanding something, but repeating what you > already said, twice, won't help me understand it. Please provide more > details about your application's needs regarding the window layout. https://github.com/rnkn/olivetti Here=E2=80=99s the minor mode. Go nuts. > Given the little that you said until now, would checking the value return= ed by > line-number-display-width in a post-command-hook solve your problem? > If not, please tell why not, and let's take it from there. No it wouldn=E2=80=99t. I don=E2=80=99t need to run code after every comman= d. Until now, the following hooks have been perfect: window-configuration-change-hook window-size-change-functions after-setting-font-hook text-scale-mode-hook n.b. window-size-change-functions only added recently due to 26.x changes. From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 04:34:23 2017 Received: (at 28844) by debbugs.gnu.org; 17 Oct 2017 08:34:23 +0000 Received: from localhost ([127.0.0.1]:44810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4NKQ-0000ym-WE for submit@debbugs.gnu.org; Tue, 17 Oct 2017 04:34:23 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42490) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4NKP-0000yD-Jc for 28844@debbugs.gnu.org; Tue, 17 Oct 2017 04:34:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4NKH-0003y8-5t for 28844@debbugs.gnu.org; Tue, 17 Oct 2017 04:34:16 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4NK5-0003pI-BC; Tue, 17 Oct 2017 04:34:01 -0400 Received: from [176.13.228.183] (port=22840 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 1e4NK4-0000p4-LC; Tue, 17 Oct 2017 04:34:01 -0400 Date: Tue, 17 Oct 2017 11:33:57 +0300 User-Agent: K-9 Mail for Android In-Reply-To: <1508224426.2790345.1141279648.61B955E6@webmail.messagingengine.com> References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> <1508074073.3557079.1139314312.4BFE5BC2@webmail.messagingengine.com> <83o9p8h2yv.fsf@gnu.org> <1508124120.3709085.1139805520.1F653A1C@webmail.messagingengine.com> <87efq37knc.fsf@gmail.com> <1508130850.3734431.1139876192.21CE8281@webmail.messagingengine.com> <83zi8rf8rx.fsf@gnu.org> <1508200557.2705080.1141019864.6A2B8BD5@webmail.messagingengine.com> <83bml6fqbv.fsf@gnu.org> <1508213954.647567.1141167720.1CC00459@webmail.messagingengine.com> <06925BCF-6C99-423B-AB13-E7331E22B867@gnu.org> <1508224426.2790345.1141279648.61B955E6@webmail.messagingengine.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook To: Paul Rankin From: Eli Zaretskii Message-ID: <460F2754-49F1-4470-8121-5CBF39C0845C@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28844 Cc: 28844@debbugs.gnu.org, agrambot@gmail.com 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: -5.0 (-----) On October 17, 2017 10:13:46 AM GMT+03:00, Paul Rankin wrote: > On Tue, 17 Oct 2017, at 03:44 PM, Eli Zaretskii wrote: > > First, let's be clear about something: it's not "my" mode=2E I'll > never use it, except > > for testing and fixing bugs=2E I implemented this feature because > line numbers are > > very popular among Emacs users, and existing solutions, like > linum-mode, slow > > down Emacs, sometimes to a crawl=2E The excitement expressed by users > on Reddit > > when the feature landed, which surprised me, is a clear evidence > that the results > > are very satisfactory, as far as users are > > concerned=2E So this feature is here to > > stay, and Lisp packages need to adapt (bundled packages already did, > AFAIK)=2E > >=20 > > Next, I *know* that I'm misunderstanding something, but repeating > what you > > already said, twice, won't help me understand it=2E Please provide > more > > details about your application's needs regarding the window layout=2E >=20 > https://github=2Ecom/rnkn/olivetti >=20 > Here=E2=80=99s the minor mode=2E Go nuts=2E >=20 > > Given the little that you said until now, would checking the value > returned by > > line-number-display-width in a post-command-hook solve your problem? > > If not, please tell why not, and let's take it from there=2E >=20 > No it wouldn=E2=80=99t=2E I don=E2=80=99t need to run code after every c= ommand=2E Until > now, the following hooks have been perfect: >=20 > window-configuration-change-hook > window-size-change-functions > after-setting-font-hook > text-scale-mode-hook >=20 > n=2Eb=2E window-size-change-functions only added recently due to 26=2Ex > changes=2E So having looked at your package, I think post-command-hook will solve you= r problem=2E All you need to do in the hook is check if line-number-display= -width returns a value different from the last time, and if so, call your functio= n olivetti-set-environment; otherwise do nothing=2E From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 20 05:42:42 2017 Received: (at 28844-done) by debbugs.gnu.org; 20 Oct 2017 09:42:42 +0000 Received: from localhost ([127.0.0.1]:51130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5TpC-0004ZM-II for submit@debbugs.gnu.org; Fri, 20 Oct 2017 05:42:42 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40104) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5TpB-0004Z7-1X for 28844-done@debbugs.gnu.org; Fri, 20 Oct 2017 05:42:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5Tp4-0007Lp-QL for 28844-done@debbugs.gnu.org; Fri, 20 Oct 2017 05:42:35 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52174) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Tox-0007KC-5V; Fri, 20 Oct 2017 05:42:27 -0400 Received: from [176.228.60.248] (port=2375 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e5Tow-00026g-N5; Fri, 20 Oct 2017 05:42:26 -0400 Date: Fri, 20 Oct 2017 12:42:18 +0300 Message-Id: <83po9icg05.fsf@gnu.org> From: Eli Zaretskii To: hello@paulwrankin.com In-reply-to: <460F2754-49F1-4470-8121-5CBF39C0845C@gnu.org> (message from Eli Zaretskii on Tue, 17 Oct 2017 11:33:57 +0300) Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> <1508074073.3557079.1139314312.4BFE5BC2@webmail.messagingengine.com> <83o9p8h2yv.fsf@gnu.org> <1508124120.3709085.1139805520.1F653A1C@webmail.messagingengine.com> <87efq37knc.fsf@gmail.com> <1508130850.3734431.1139876192.21CE8281@webmail.messagingengine.com> <83zi8rf8rx.fsf@gnu.org> <1508200557.2705080.1141019864.6A2B8BD5@webmail.messagingengine.com> <83bml6fqbv.fsf@gnu.org> <1508213954.647567.1141167720.1CC00459@webmail.messagingengine.com> <06925BCF-6C99-423B-AB13-E7331E22B867@gnu.org> <1508224426.2790345.1141279648.61B955E6@webmail.messagingengine.com> <460F2754-49F1-4470-8121-5CBF39C0845C@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28844-done Cc: agrambot@gmail.com, 28844-done@debbugs.gnu.org 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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Tue, 17 Oct 2017 11:33:57 +0300 > From: Eli Zaretskii > Cc: 28844@debbugs.gnu.org, agrambot@gmail.com > > So having looked at your package, I think post-command-hook will solve your > problem. All you need to do in the hook is check if line-number-display-width > returns a value different from the last time, and if so, call your function > olivetti-set-environment; otherwise do nothing. Another possibility is to use pre-redisplay-function. An example is in tabulated-list.el. Anyway, since there were no further comments, I'm marking this bug done. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 22 03:20:46 2017 Received: (at 28844) by debbugs.gnu.org; 22 Oct 2017 07:20:46 +0000 Received: from localhost ([127.0.0.1]:54871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e6AYw-0002eY-Ev for submit@debbugs.gnu.org; Sun, 22 Oct 2017 03:20:46 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:49735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e6AYu-0002eQ-Pm for 28844@debbugs.gnu.org; Sun, 22 Oct 2017 03:20:45 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id D53C0209B6; Sun, 22 Oct 2017 03:20:43 -0400 (EDT) Received: from web5 ([10.202.2.215]) by compute3.internal (MEProxy); Sun, 22 Oct 2017 03:20:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paulwrankin.com; h=content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=t16b4NcOIe6pFX6lOjWh56oT+6ntoGLTW3Ko2Zr4bdk=; b=ZZUwo8+t iwHQUO483DX+CzjPtlSl8HLRuMTcrqTS1+lPyXA7Y3Hfo8vB3Ir7w4wz9Kj8h6L/ DeqCjqtcgDCwe6qbqYg7wBUTURx4idGV+eDzPqkWCMNihprILWstO/lNBATQPwpL zNtSbVXqvl/FFWAqjNiIkaJFtYhlb4lQG7HqLQXOlvSbHBM+U+4+nGzZp07KNHw+ bsqLmTzLnSOsWBMxbQ4dhDwZt7oqUYgHpoLP9wdbAGmISDdXzk/oT61Ty0NV3Ts5 xEW2uIGpynwuVesj0hpjzMsMYcEjqe1lhfXDQvA6dgtXXhtPgdf45J0punOC+J6W LbvDpyKKqyC13Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=t16b4NcOIe6pFX6lOjWh56oT+6nto GLTW3Ko2Zr4bdk=; b=C5aqf660PYk8IQcMMZYLJM1kY0ygNbgPQhSg6EvrDfOKJ PtSQ/tBsGg3s/ReQPkr7RtBaqbVj1+LLg989jJxsrRbrBHN9u9CJVqDioa3XqOtq iqWczIAREWK/aL9Hv3afxAKF6Ra0zeGm+lSasw+rYNqnalK6+HoyjX9X9gFEKU94 H28RfHvA/PaFjGIAq3fjrENXXBh3s5JO3lQhax1HLbbLh2wCw/L3YsTYJXcEx8rM oTECEcV24oo9K0vEGxjuOhoxXWYKorXThaUngTf3dBrcx1l/XUmF7XkL6THM1N1G eBTfwYW9n1fLE0Rp3xTgi8unzMkw3C6fZz47vu7sg== X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 9C4F69E282; Sun, 22 Oct 2017 03:20:43 -0400 (EDT) Message-Id: <1508656843.1733620.1146804384.5B4FCEDF@webmail.messagingengine.com> From: Paul Rankin To: 28844@debbugs.gnu.org, eliz@gnu.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-26fdae60 Subject: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook Date: Sun, 22 Oct 2017 17:20:43 +1000 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 28844 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: -0.7 (/) > Another possibility is to use pre-redisplay-function. An example is > in tabulated-list.el. I made the above changes and added to 'pre-redisplay-function but this does not work. It makes no sense to put the onus on existing working packages to endlessly fiddle to work around bugs you have introduced. Please find a solution on your end so that this bug may be closed. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 22 10:27:18 2017 Received: (at 28844) by debbugs.gnu.org; 22 Oct 2017 14:27:18 +0000 Received: from localhost ([127.0.0.1]:56009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e6HDi-0006Yo-6v for submit@debbugs.gnu.org; Sun, 22 Oct 2017 10:27:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e6HDf-0006YY-Ie for 28844@debbugs.gnu.org; Sun, 22 Oct 2017 10:27:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6HDW-0006qW-Ct for 28844@debbugs.gnu.org; Sun, 22 Oct 2017 10:27:10 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40190) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6HDW-0006qS-9O; Sun, 22 Oct 2017 10:27:06 -0400 Received: from [176.228.60.248] (port=1328 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e6HDV-00075P-O1; Sun, 22 Oct 2017 10:27:06 -0400 Date: Sun, 22 Oct 2017 17:27:02 +0300 Message-Id: <83bmkzb6mh.fsf@gnu.org> From: Eli Zaretskii To: Paul Rankin In-reply-to: <1508656843.1733620.1146804384.5B4FCEDF@webmail.messagingengine.com> (message from Paul Rankin on Sun, 22 Oct 2017 17:20:43 +1000) Subject: Re: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook References: <1508656843.1733620.1146804384.5B4FCEDF@webmail.messagingengine.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28844 Cc: 28844@debbugs.gnu.org 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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Paul Rankin > Date: Sun, 22 Oct 2017 17:20:43 +1000 > > > Another possibility is to use pre-redisplay-function. An example is > > in tabulated-list.el. > > I made the above changes and added to 'pre-redisplay-function but this does not work. If you'd like me to look into this, please provide the details: what changes you made, and how it failed to work (including a recipe for reproducing the wrong behavior, please). I've looked at your package on GitHub, but didn't see any code related to pre-redisplay-function; apologies if I missed something. > It makes no sense to put the onus on existing working packages to endlessly fiddle to work around bugs you have introduced. If there's a bug in Emacs, sure. But I see no bug yet: the code in Emacs is working as designed, and based on adapting several bundled packages to the line-number display, my conclusion was that the existing facilities are enough to support that. Maybe your package's needs will convince me to change my mind, but for that I need to understand the problem better. And if I'm right, then making the changes to adapt your package (should you decide that such adaptations are necessary) is indeed your responsibility as the package developer. Thanks. From unknown Sat Jun 21 03:16:08 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 20 Nov 2017 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 07 20:58:28 2017 Received: (at control) by debbugs.gnu.org; 8 Dec 2017 01:58:28 +0000 Received: from localhost ([127.0.0.1]:51190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eN7vo-0002DJ-Io for submit@debbugs.gnu.org; Thu, 07 Dec 2017 20:58:28 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:39573) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eN7vn-0002DD-MX for control@debbugs.gnu.org; Thu, 07 Dec 2017 20:58:27 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 392E220B1E for ; Thu, 7 Dec 2017 20:58:27 -0500 (EST) Received: from web5 ([10.202.2.215]) by compute3.internal (MEProxy); Thu, 07 Dec 2017 20:58:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paulwrankin.com; h=content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=T9x3zxjru1X5F3x+VSwErdKFxcBT+YWE1Qi3A494K70=; b=XT9lb4vg OHINpjVy/gTxgpb0FV3TXkJ4sNA8Yub+gOxvJPXPAY78quqPkSXfOZCVRkjrkyo5 pY4ujHsbzBQTTnBU+xvK+nfOYOyYdBmOKdMJ2k5edV45Nb6edrdCiDvtZCfKo7xZ hZ5MfvlcH6xH7DHFSuVFiPSex3b4lbNxKMEsCk1rEZf7vjvEhZo+KzVXBeKluopB lH61r4lojDrUnFdqTKghnRxw9BTeOFaagRbftFPEH2q9GrsrV8euNpX6wtB0fOqr FEQnRQ1qGnCME2hrJaji2P7N/JIUvC+8YEt79dCxaET9q2Ji1X6P1z6qR6ymsM4e eLMIp4iUzF346Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=T9x3zxjru1X5F3x+VSwErdKFxcBT+ YWE1Qi3A494K70=; b=UNOIgH7OMAUHmvyPhEvDgLgFiht3eCuBNislh5bqpKckv qthC8kJXC1Il6SOOK2SK+AfZt13PjO9RDVcT1LrUnzY5LrI+wwBLOe3apx44oFOF xMKB5hpI/JZihFRz5Zi8OsBT5j1B+gdiSmGObczPjplbROzJZpL64S+dx4epR/ip XWgbQ4zmRQOo7Vusk3y04ZEVxzpodT+InN2A2XhYnoc1s6gPT7GA5u82JOcXEavk piPFrUrIMkTJ1rS0JWDTVepcBkMeEzQqJfDwkW5Dgd6paAWMhOAxrDnuX8rCt/VV F9ebHOawpw3NAndkD719mxM5VzO2VUN1MDtYiO2xQ== X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 0329A9E086; Thu, 7 Dec 2017 20:58:26 -0500 (EST) Message-Id: <1512698306.3653915.1198005296.1D057F2A@webmail.messagingengine.com> From: Paul Rankin To: control@debbugs.gnu.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-1b87d328 Subject: unarchive 28844 Date: Fri, 08 Dec 2017 11:58:26 +1000 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control 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: -0.7 (/) unarchive 28844 From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 07 21:14:05 2017 Received: (at 28844) by debbugs.gnu.org; 8 Dec 2017 02:14:05 +0000 Received: from localhost ([127.0.0.1]:51203 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eN8Au-0004Up-4f for submit@debbugs.gnu.org; Thu, 07 Dec 2017 21:14:05 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:45607) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eN8As-0004Uh-Uy for 28844@debbugs.gnu.org; Thu, 07 Dec 2017 21:14:03 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id B206E20AAB; Thu, 7 Dec 2017 21:14:02 -0500 (EST) Received: from web5 ([10.202.2.215]) by compute3.internal (MEProxy); Thu, 07 Dec 2017 21:14:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paulwrankin.com; h=cc:content-transfer-encoding:content-type:date:from :message-id:mime-version:subject:to:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=mXnlcLlamwpb4Op+QEbx4CUYqO0/Xe/v1685jyfus 6U=; b=BMCJ+uXJCp0ZDL5xrCtrhiVZh966cA9O8txsKu+MgnsOkFD8UyAKlp4QL r7NTbDN7R3KV8YXI+e/7kFnR6TqWiVbwO4Wdio1tTJy2JeqEPH2Voe1XPa/cw9CM 0XoMRM2jcGD5WfjEd8AS7vlInznq9sNrH+8FmE4R/psGRNKv68h9fxGGTv1eC6m0 8293gwZn304IBjqSg4gPPwDAenoDt+KkdPaj6ysyGMnZMKlp2B0BBv7ARqTbh6+E g9rfmxLGiwiMc91McPHQfHGh5tnaINoykBRgA2smRGALTlvgH+5HDNSEeoraBK4T mDcLwl+SkXk1RwgI6x/O4kauc6klw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=mXnlcLlamwpb4Op+QEbx4CUYqO0/X e/v1685jyfus6U=; b=r0urlc5eYCvU6EYJnt9iO7DFjFz7PnOe3nknsNwT9t/vy Iw1IZntVRge7lGGonK+Yi7h2hIyWvNlOCdVBt/vupDUNH33KlyFVKJcGcyPQn6f4 UJV3dm0z/QlJks4VQWDTfKUW/GF7ghc1A5lMHmXApLVd2WRpDUsN2kiiIs/aP9/u h4NYySaLj+ks47bBEJb+xTykYLJDkrI+Da06ntPxnN9FhmdztWBssX+RE75XB6J2 y6OThn0cPHOMHbf9rScHaIbmjK7+g04LiNDLGgdgNqElNf0gHLFY1UrvrrF9SaGe fmMVCiGcVCUP6snULF3+O6ZA8IkNnV8Hgb+myI27Q== X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 882469E087; Thu, 7 Dec 2017 21:14:02 -0500 (EST) Message-Id: <1512699242.3658603.1198014544.7EB49FB0@webmail.messagingengine.com> From: Paul Rankin To: 28844@debbugs.gnu.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-1b87d328 Subject: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook Date: Fri, 08 Dec 2017 12:14:02 +1000 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 28844 Cc: eliz@gnu.org 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: -0.7 (/) Eli, I understand that your blindness to this bug is probably due to your o= wn bias. I get it, you wrote the code, you enjoyed the previously mentioned= reddit upvotes for it, I understand you don=E2=80=99t want to admit that y= our code has flaws. But you need to understand that your way of seeing thin= gs is subjective and not universal. The bug is that when the user scrolls up or down, past a point where the wi= dth of the line numbers changes from e.g. 99 to the number width from 2 to = 3 thus making the width of line number display change from 4 to 5, display-= line-numbers-mode necessarily changes the window display configuration to a= ccommodate this character. However, display-line-numbers-mode doesn=E2=80=99t appear to tell the rest = of Emacs about this change, so even if we all wanted to accommodate your di= splay changes, as far as I can tell, we cannot. It=E2=80=99s nice that you added the token function line-number-display-wid= th, but aside from the bug with its return value being off by 2 (#29597), t= his function is not useful unless other lisp programs know *when* to call i= t. The easiest solution, the one that baffles me why you haven=E2=80=99t just = included already rather than continue to argue with me, is that when displa= y-line-numbers-mode changes the window, you run window-configuration-change= -hook. If, for some Eli-reason, you don=E2=80=99t want to run window-configuration= -change-hook, you can add a simple hook, which gets run whenever display-li= ne-numbers-mode needs to change the window configuration. Then other lisp p= rograms can call line-number-display-width, and provided its bug gets fixed= and it returns the correct width, everyone is happy. Is there anything about this that=E2=80=99s not clear to you? From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 07 21:43:39 2017 Received: (at 28844) by debbugs.gnu.org; 8 Dec 2017 02:43:39 +0000 Received: from localhost ([127.0.0.1]:51226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eN8dW-0005Bz-U4 for submit@debbugs.gnu.org; Thu, 07 Dec 2017 21:43:39 -0500 Received: from mail-it0-f45.google.com ([209.85.214.45]:38411) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eN8dV-0005Bm-0g for 28844@debbugs.gnu.org; Thu, 07 Dec 2017 21:43:37 -0500 Received: by mail-it0-f45.google.com with SMTP id r6so1787915itr.3 for <28844@debbugs.gnu.org>; Thu, 07 Dec 2017 18:43:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=SrCloypitVu28I3XA/cLFbn7+nH8LK4rXJFtWnmk3NU=; b=Xj/GbFPGJbQvrgH+Co0CMJOkCZOvzZhHFdBHECIUkO1UCg9KfDLjN1nLh/UV+XzFCa +T4yw93T9YLziEEemUJv2tM/eiuMqKOvoWlxYTf9+WstZO69QaQcE0VmNlSFS1mKQw5j oZeiv2rCcWeQpBualfKgzMFOqhGZeM3+3ivM/J11Nr8pvijRAUc60UIC70ULNlrP1dQV zX2AHowtJxFpJ7vT/6ngOALqdP/WH5pp/RuT9mPKQKN/dtWqfoDfLadOWuIUabutjuX7 M/rHjgRi6oqDYxFqNUGiRH9+MchPtbRBgEVJwa/jCWwrLSqNwoMoE1PXkHUQrXYJQOHm 9uYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version :content-transfer-encoding; bh=SrCloypitVu28I3XA/cLFbn7+nH8LK4rXJFtWnmk3NU=; b=eDBOBkzlirqlvEZTU/dwZLx06O+/hNiQGlG4Emc4P/JUd+RqRhV2wOvR27fje5yv64 57omj58+aXDHkvhDXz5ZhlVWusvB4HzGcELFSDv3qy+ksoUL0f7/LMWOZJ18UUNU07E1 VwaoBFaB5UauUbUR0OuvAs4se5VpLjX3gB1S1IqjMg17BYXa5em1snPNeYTM5NCfp4X6 OxJapvmp/WG6wwm0jOByw2D7vENMSKSYCgNGiJ4iLeNJvi1lsgD+g8XktyUV8IzJ6dgS Sy3PNVZVViPx1FmXbvmsWUUqCNz6/BtfFGbqU0LLOuFUPsrcaKnSDoXOXttdh3D1OOfO mcwg== X-Gm-Message-State: AKGB3mJfOg2pkJdx6qOZuulkq8ZsuF2VJTehbQ1tN45/D1hWHcAy/JHz 4Oo+tYrXbF/YZXy9XaXDp74= X-Google-Smtp-Source: AGs4zMYNyydQMwmWMxa1HC4SfFOS/an3qOcJX+SD5hGzUXCKBy7/Z6QsDZunyNb0WBn63f5UODDrDg== X-Received: by 10.36.125.129 with SMTP id b123mr4038181itc.142.1512701011534; Thu, 07 Dec 2017 18:43:31 -0800 (PST) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id m184sm305004itg.8.2017.12.07.18.43.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Dec 2017 18:43:30 -0800 (PST) From: Noam Postavsky To: Paul Rankin Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> <1508074073.3557079.1139314312.4BFE5BC2@webmail.messagingengine.com> <83o9p8h2yv.fsf@gnu.org> <1508124120.3709085.1139805520.1F653A1C@webmail.messagingengine.com> <87efq37knc.fsf@gmail.com> <1508130850.3734431.1139876192.21CE8281@webmail.messagingengine.com> <83zi8rf8rx.fsf@gnu.org> <1508200557.2705080.1141019864.6A2B8BD5@webmail.messagingengine.com> <83bml6fqbv.fsf@gnu.org> <1508213954.647567.1141167720.1CC00459@webmail.messagingengine.com> <06925BCF-6C99-423B-AB13-E7331E22B867@gnu.org> <1508224426.2790345.1141279648.61B955E6@webmail.messagingengine.com> Date: Thu, 07 Dec 2017 21:43:29 -0500 In-Reply-To: <1508224426.2790345.1141279648.61B955E6@webmail.messagingengine.com> (Paul Rankin's message of "Tue, 17 Oct 2017 17:13:46 +1000") Message-ID: <87a7yuey7i.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 28844 Cc: Eli Zaretskii , 28844@debbugs.gnu.org, agrambot@gmail.com 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: 0.5 (/) Paul Rankin writes: >> Given the little that you said until now, would checking the value retur= ned by >> line-number-display-width in a post-command-hook solve your problem? >> If not, please tell why not, and let's take it from there. > > No it wouldn=E2=80=99t. I don=E2=80=99t need to run code after every comm= and. You don't *need* to, but it would still work to run code some extra times. You just think it would be less efficient than having a dedicated hook, correct? Whereas my understanding of #20 is that Eli thinks adding a dedicated hook would be less efficient than using post-command-hook. https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D28844#20 PS You seem awful quick to jump to Ad Hominem, it makes resolving bug reports needlessly unpleasant. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 08 09:49:26 2017 Received: (at 28844) by debbugs.gnu.org; 8 Dec 2017 14:49:26 +0000 Received: from localhost ([127.0.0.1]:51561 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNJxu-0000Y3-9d for submit@debbugs.gnu.org; Fri, 08 Dec 2017 09:49:26 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNJxs-0000Xq-Mr for 28844@debbugs.gnu.org; Fri, 08 Dec 2017 09:49:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNJxm-0004TP-AW for 28844@debbugs.gnu.org; Fri, 08 Dec 2017 09:49:19 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39741) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNJxg-0004Qt-JM; Fri, 08 Dec 2017 09:49:12 -0500 Received: from [176.228.60.248] (port=3199 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eNJxf-0004qo-BS; Fri, 08 Dec 2017 09:49:12 -0500 Date: Fri, 08 Dec 2017 16:48:46 +0200 Message-Id: <83a7ytwa0h.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-reply-to: <87a7yuey7i.fsf@users.sourceforge.net> (message from Noam Postavsky on Thu, 07 Dec 2017 21:43:29 -0500) Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> <1508074073.3557079.1139314312.4BFE5BC2@webmail.messagingengine.com> <83o9p8h2yv.fsf@gnu.org> <1508124120.3709085.1139805520.1F653A1C@webmail.messagingengine.com> <87efq37knc.fsf@gmail.com> <1508130850.3734431.1139876192.21CE8281@webmail.messagingengine.com> <83zi8rf8rx.fsf@gnu.org> <1508200557.2705080.1141019864.6A2B8BD5@webmail.messagingengine.com> <83bml6fqbv.fsf@gnu.org> <1508213954.647567.1141167720.1CC00459@webmail.messagingengine.com> <06925BCF-6C99-423B-AB13-E7331E22B867@gnu.org> <1508224426.2790345.1141279648.61B955E6@webmail.messagingengine.com> <87a7yuey7i.fsf@users.sourceforge.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28844 Cc: hello@paulwrankin.com, 28844@debbugs.gnu.org, agrambot@gmail.com 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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Noam Postavsky > Cc: Eli Zaretskii , 28844@debbugs.gnu.org, agrambot@gmail.com > Date: Thu, 07 Dec 2017 21:43:29 -0500 > > Paul Rankin writes: > > Whereas my understanding of #20 is that Eli thinks adding a dedicated > hook would be less efficient than using post-command-hook. > > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28844#20 Not just less efficient, but also much more problematic for the display code as a whole from the implementation POV. > PS You seem awful quick to jump to Ad Hominem, it makes resolving bug > reports needlessly unpleasant. Well put, thanks. "Unpleasant" indeed. (I might have used stronger words here, but then I'm the one who is being attacked, so I'm probably -- what was that word? ah, yes: "biased".) More to the point, I've offered help, based on my experience in adapting other packages to this new feature. See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28844#53 I'm willing to do more, and propose working code, but being unfamiliar with your package, I need some help understanding what is the expected behavior when certain display-related attributes change. For example, what should happen if the user enlarges or makes smaller the default face's font with the likes of "C-x +"? I'm asking this because the effect on the display margins is similar, so I wanted to look what the package does in that case, but it seems to do nothing: the margin dimensions are not changed as I'd expect them to. So I couldn't do more than just suggest a way to solve this. Maybe I missed some setting or knob. I actually think the problem is not so hard and could be solved quite easily, but your help, Paul, is needed to make this happen. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 08 10:23:14 2017 Received: (at 28844) by debbugs.gnu.org; 8 Dec 2017 15:23:14 +0000 Received: from localhost ([127.0.0.1]:52694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNKUa-0001Zh-P6 for submit@debbugs.gnu.org; Fri, 08 Dec 2017 10:23:14 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39125) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNKUY-0001ZT-Rf for 28844@debbugs.gnu.org; Fri, 08 Dec 2017 10:23:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNKUP-0006xc-2M for 28844@debbugs.gnu.org; Fri, 08 Dec 2017 10:23:05 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNKUO-0006xX-U9; Fri, 08 Dec 2017 10:23:00 -0500 Received: from [176.228.60.248] (port=3213 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eNKUN-00065y-F3; Fri, 08 Dec 2017 10:23:00 -0500 Date: Fri, 08 Dec 2017 17:22:35 +0200 Message-Id: <837etxw8g4.fsf@gnu.org> From: Eli Zaretskii To: Paul Rankin In-reply-to: <1512699242.3658603.1198014544.7EB49FB0@webmail.messagingengine.com> (message from Paul Rankin on Fri, 08 Dec 2017 12:14:02 +1000) Subject: Re: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook References: <1512699242.3658603.1198014544.7EB49FB0@webmail.messagingengine.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28844 Cc: 28844@debbugs.gnu.org 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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Paul Rankin > Cc: eliz@gnu.org > Date: Fri, 08 Dec 2017 12:14:02 +1000 > > The bug is that when the user scrolls up or down, past a point where the width of the line numbers changes from e.g. 99 to the number width from 2 to 3 thus making the width of line number display change from 4 to 5, display-line-numbers-mode necessarily changes the window display configuration to accommodate this character. > > However, display-line-numbers-mode doesn’t appear to tell the rest of Emacs about this change, so even if we all wanted to accommodate your display changes, as far as I can tell, we cannot. Nevertheless modes like tabulated-list-mode, the list-packages display based on it, and others have been adapted to this new feature. Which means that doing so is not only possible, it is also relatively easy. Your mode needs to do something similar. I'm willing to help if you answer a few questions, so I understand the expectations of your users better than I do now. > It’s nice that you added the token function line-number-display-width, but aside from the bug with its return value being off by 2 (#29597), this function is not useful unless other lisp programs know *when* to call it. You are wrong here on both counts: the value of 2 is not a bug (see how display-line-numbers.el uses this if you want to understand the details); and the function is useful enough to be the basis for all the adaptations I did in core Emacs features (some of them are mentioned above). I'm quite sure this function will also allow to adapt your package to this feature. A little cooperation from you is all that is required. We could already have this solved, if we hadn't wasted time on these futile arguments. > The easiest solution, the one that baffles me why you haven’t just included already rather than continue to argue with me, is that when display-line-numbers-mode changes the window, you run window-configuration-change-hook. I explained why this would be a bad idea in several related discussions. I invite you to read them, if you want to understand my reasons better, and I'm willing to answer further questions regarding those issues. Of course, you don't _need_ to read those discussions and/or dig into the related code and understand it, if you don't want to. You could instead simply trust me when I say, based on some years of hacking the Emacs display code: THIS IS A BAD IDEA! So bad that if someone wants to implement it against my best judgment, they will need to do that over my dead body. > If, for some Eli-reason, you don’t want to run window-configuration-change-hook, you can add a simple hook, which gets run whenever display-line-numbers-mode needs to change the window configuration. Then other lisp programs can call line-number-display-width, and provided its bug gets fixed and it returns the correct width, everyone is happy. See above: you are talking out of lack of knowledge. You don't know and don't understand how this feature works, how it plugs into the Emacs display code, and therefore cannot appreciate what havoc will be caused by running any such hooks when line numbers are being rendered. I do understand all that stuff, and that is why I'm opposed to doing it. And based on my experience of adapting several Emacs features to the line-number display, I can be confident that such a hook is not needed, that existing APIs, including line-number-display-width, are enough. > Is there anything about this that’s not clear to you? The only thing that is not clear to me is why do you prefer to attack me personally instead of trying to adapt your package to Emacs development. Don't you want your package to be used by many people who like line numbers in their buffers? Then please drop the attitude, and let's instead work together to make those adaptations. From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 09 10:30:44 2017 Received: (at 28844) by debbugs.gnu.org; 9 Dec 2017 15:30:45 +0000 Received: from localhost ([127.0.0.1]:53995 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNh5Q-0002ck-Ni for submit@debbugs.gnu.org; Sat, 09 Dec 2017 10:30:44 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:59573) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNh5P-0002cd-Eu for 28844@debbugs.gnu.org; Sat, 09 Dec 2017 10:30:43 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 1B5242012A; Sat, 9 Dec 2017 10:30:42 -0500 (EST) Received: from web5 ([10.202.2.215]) by compute3.internal (MEProxy); Sat, 09 Dec 2017 10:30:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paulwrankin.com; h=content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=f6OSkLkcqjzHHYtSkZatBigfMp4TC 8UklzMzE7kkSDg=; b=qmls8y/NtA0hn24KGEXdA64cJU41cGtwMSIguCv0DdEZ6 jdIGBn3PQIcGGrUYoZIl9bquJ53m2xVdCNT2B0L4UxJC+I3P72y/Yirgj9kze8PV Nty4dfpL9e8yT0hfnGLnqRevLIywh6nskmu7r5glcFjfDcKY6dRrCswqf+Cgqtok OouDH71cpZZkxTtMZStRPxj5GZUCgktb2uxQBVCI1WpnSHVPTnpsZCh5RGjRAusp BHyKusg2/FTboVxZd6vVL+1029AR1nmXJ/Yt9WetseNWKMxvpAUMSpT7wkCM9ZDY 1VNRDE4sNhJaVe4lt9AoIXjvwEb487lGN7Eo+aEHQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=f6OSkL kcqjzHHYtSkZatBigfMp4TC8UklzMzE7kkSDg=; b=dsALPd09p9AMuV3EhXm4J5 5PTZDxBvfuxxhhwcokQQ53GBLxD7D4jyqIBDMw66jLZyPSCEHnbO7umCbCPpeB67 l+5QLSzMqAab2ZICDCkzgDXMchuGYgBS8GbneWgbLe+rXDYqaCTDdiTCCrY2zrKI +p60opsp21CM64zwe2J7p7f0MQTYZNFNwGtLYRohPS6/NgOUcPt5PtEDXnQNPcSP BwmJfHG1JI4CdLzqgCZDBnHagYemSLA6LiS5xxMcGaKIWRMbsl3LedJ+Y3Hn2g5h vAMH7Yo3I9D+CrvfkZhk/+n2vIg5l/VWE1Zvhud71Fq1pCjmXZBy5tzNiUDGzJ4Q == X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id D8F989E094; Sat, 9 Dec 2017 10:30:41 -0500 (EST) Message-Id: <1512833441.1115759.1199488160.6523D7E7@webmail.messagingengine.com> From: Paul Rankin To: Noam Postavsky , Eli Zaretskii , 28844@debbugs.gnu.org, agrambot@gmail.com MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-c9e5630e Date: Sun, 10 Dec 2017 01:30:41 +1000 References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> <1508074073.3557079.1139314312.4BFE5BC2@webmail.messagingengine.com> <83o9p8h2yv.fsf@gnu.org> <1508124120.3709085.1139805520.1F653A1C@webmail.messagingengine.com> <87efq37knc.fsf@gmail.com> <1508130850.3734431.1139876192.21CE8281@webmail.messagingengine.com> <83zi8rf8rx.fsf@gnu.org> <1508200557.2705080.1141019864.6A2B8BD5@webmail.messagingengine.com> <83bml6fqbv.fsf@gnu.org> <1508213954.647567.1141167720.1CC00459@webmail.messagingengine.com> <06925BCF-6C99-423B-AB13-E7331E22B867@gnu.org> <1508224426.2790345.1141279648.61B955E6@webmail.messagingengine.com> <87a7yuey7i.fsf@users.sourceforge.net> Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook In-Reply-To: <87a7yuey7i.fsf@users.sourceforge.net> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 28844 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: -0.7 (/) I=E2=80=99d like to acknowledge how much of an ass I=E2=80=99ve been toward= s Eli in this thread. I=E2=80=99ve emailed Eli personally, but I think I owe him a public apology, and an apology to everyone else whom I made uncomfortable with my increasingly rude and condescending responses towards him. I had misinterpreted Eli=E2=80=99s earlier responses to me as dismissive, a= nd thought he was biased in favour of his own code and was dismissing my concerns in order to avoid fixing something I thought was wrong/broken. I made the assumption that post-command-hook would be called many, many more times than window-configuration-change- hook, an assumption I made without testing the theory, and then continued attacking him. Now I realise he wasn=E2=80=99t suggesting post-command-hook as a lazy quick fix, but this would in fact improve my code. I=E2=80=99m sorry Eli, and everyone else in this thread. I should have shown gratitude for your help instead of such arrogance. > I'm willing to do more, and propose working code, but being unfamiliar > with your package, I need some help understanding what is the expected > behavior when certain display-related attributes change. For example, > what should happen if the user enlarges or makes smaller the default > face's font with the likes of "C-x +=E2=80=9D? The basic idea of the package is to take a text body width value (integer or float) and keep the margins balanced on either side in each window the buffer is displayed. Whenever anything display-related changes, the package calls olivetti-set-environment. This function calls olivetti-scale-width to account for any changes to the font size. > I'm asking this because the effect on the display margins is similar, > so I wanted to look what the package does in that case, but it seems > to do nothing: the margin dimensions are not changed as I'd expect > them to. So I couldn't do more than just suggest a way to solve this. > Maybe I missed some setting or knob. I=E2=80=99m going to implement post-command-hook as you suggested, and once= the API for line-number-display-width is locked I will call that to account for display-line-numbers. You know, the silly thing is... olivetti is designed for prose writing, most people will never use it in conjunction with line numbers... From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 09 11:01:52 2017 Received: (at 28844) by debbugs.gnu.org; 9 Dec 2017 16:01:52 +0000 Received: from localhost ([127.0.0.1]:54019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNhZY-0003K4-2B for submit@debbugs.gnu.org; Sat, 09 Dec 2017 11:01:52 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43583) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNhZW-0003Jr-Mu for 28844@debbugs.gnu.org; Sat, 09 Dec 2017 11:01:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNhZQ-0002k3-NN for 28844@debbugs.gnu.org; Sat, 09 Dec 2017 11:01:45 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33968) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNhZK-0002i6-OC; Sat, 09 Dec 2017 11:01:38 -0500 Received: from [176.228.60.248] (port=1313 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eNhZI-0000Bm-RP; Sat, 09 Dec 2017 11:01:38 -0500 Date: Sat, 09 Dec 2017 18:01:10 +0200 Message-Id: <83vahfubzt.fsf@gnu.org> From: Eli Zaretskii To: Paul Rankin In-reply-to: <1512833441.1115759.1199488160.6523D7E7@webmail.messagingengine.com> (message from Paul Rankin on Sun, 10 Dec 2017 01:30:41 +1000) Subject: Re: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook References: <1508054203.3504379.1139170720.0D0E99E9@webmail.messagingengine.com> <59E32D49.4030007@gmx.at> <1508065717.3534312.1139251176.600E646A@webmail.messagingengine.com> <59E350AE.3060005@gmx.at> <1508074073.3557079.1139314312.4BFE5BC2@webmail.messagingengine.com> <83o9p8h2yv.fsf@gnu.org> <1508124120.3709085.1139805520.1F653A1C@webmail.messagingengine.com> <87efq37knc.fsf@gmail.com> <1508130850.3734431.1139876192.21CE8281@webmail.messagingengine.com> <83zi8rf8rx.fsf@gnu.org> <1508200557.2705080.1141019864.6A2B8BD5@webmail.messagingengine.com> <83bml6fqbv.fsf@gnu.org> <1508213954.647567.1141167720.1CC00459@webmail.messagingengine.com> <06925BCF-6C99-423B-AB13-E7331E22B867@gnu.org> <1508224426.2790345.1141279648.61B955E6@webmail.messagingengine.com> <87a7yuey7i.fsf@users.sourceforge.net> <1512833441.1115759.1199488160.6523D7E7@webmail.messagingengine.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 28844 Cc: 28844@debbugs.gnu.org, agrambot@gmail.com, npostavs@users.sourceforge.net 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: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Paul Rankin > Date: Sun, 10 Dec 2017 01:30:41 +1000 > > I’m sorry Eli, and everyone else in this thread. I should have shown > gratitude for your help instead of such arrogance. Thanks. > > For example, > > what should happen if the user enlarges or makes smaller the default > > face's font with the likes of "C-x +”? > > The basic idea of the package is to take a text body width value > (integer or float) and keep the margins balanced on either side in each > window the buffer is displayed. Whenever anything display-related > changes, the package calls olivetti-set-environment. This function calls > olivetti-scale-width to account for any changes to the font size. I see. This does work with "C-x +", but when I try changing the font size via mouse-appearance-menu (by clicking S-mouse-1), the margins seem to not react to the change. (I was mistaken above to ask about "C-x +", the problem is with selecting a font from the font menu.) > I’m going to implement post-command-hook as you suggested, and once the > API for line-number-display-width is locked I will call that to account > for display-line-numbers. Sounds like a good idea. Let me know if you need help in using the current line-number-display-width as part of implementing this idea. I think with the current APIs you want to call line-number-display-width with the optional argument 'columns'. This is especially important if the 'line-number' face is customized to use a font different from the one used to display the buffer text. > You know, the silly thing is... olivetti is designed for prose writing, > most people will never use it in conjunction with line numbers... I know. I myself never use line numbers, and only wrote the code because so many people do via linum.el and similar packages, and then complain that Emacs redisplay slows down too much. From unknown Sat Jun 21 03:16:08 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 07 Jan 2018 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator