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 11:33:57 +0300 Message-ID: <460F2754-49F1-4470-8121-5CBF39C0845C@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> <06925BCF-6C99-423B-AB13-E7331E22B867@gnu.org> <1508224426.2790345.1141279648.61B955E6@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 1508229321 3525 195.159.176.226 (17 Oct 2017 08:35:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 17 Oct 2017 08:35:21 +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 10:35:16 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 1e4NLE-0008CD-H4 for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Oct 2017 10:35:12 +0200 Original-Received: from localhost ([::1]:37195 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4NLL-0007lv-Se for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Oct 2017 04:35:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4NLA-0007lG-Gc for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 04:35:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4NL4-0004Ns-So for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 04:35:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36132) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4NL4-0004Ni-Ok for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 04:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e4NL4-000105-H9 for bug-gnu-emacs@gnu.org; Tue, 17 Oct 2017 04:35: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 08:35:02 +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.15082292633772 (code B ref 28844); Tue, 17 Oct 2017 08:35:02 +0000 Original-Received: (at 28844) by debbugs.gnu.org; 17 Oct 2017 08:34:23 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 In-Reply-To: <1508224426.2790345.1141279648.61B955E6@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:138592 Archived-At: 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