From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook Date: Tue, 17 Oct 2017 08:44:06 +0300 Message-ID: <06925BCF-6C99-423B-AB13-E7331E22B867@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> <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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1508219119 15752 195.159.176.226 (17 Oct 2017 05:45:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 17 Oct 2017 05:45:19 +0000 (UTC) User-Agent: K-9 Mail for Android Cc: 28844@debbugs.gnu.org, agrambot@gmail.com To: Paul Rankin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 17 07:45:14 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4Kgg-0002dY-GT for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Oct 2017 07:45:10 +0200 Original-Received: from localhost ([::1]:36630 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4Kgk-0003l1-Pw for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Oct 2017 01:45:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4Kgb-0003kw-MS for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 01:45:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4KgY-0004j1-I0 for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 01:45:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35952) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4KgY-0004is-EC for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 01:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e4KgY-0005LH-18 for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 01:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Oct 2017 05:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28844 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28844-submit@debbugs.gnu.org id=B28844.150821907120478 (code B ref 28844); Tue, 17 Oct 2017 05:45:01 +0000 Original-Received: (at 28844) by debbugs.gnu.org; 17 Oct 2017 05:44:31 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 In-Reply-To: <1508213954.647567.1141167720.1CC00459@webmail.messagingengine.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:138580 Archived-At: 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