From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook Date: Mon, 16 Oct 2017 09:41:50 +0200 Message-ID: <59E462BE.1040101@gmx.at> 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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1508139818 32187 195.159.176.226 (16 Oct 2017 07:43:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 16 Oct 2017 07:43:38 +0000 (UTC) Cc: hello@paulwrankin.com, 28844@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 16 09:43:34 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 1e403W-0006U1-7R for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Oct 2017 09:43:22 +0200 Original-Received: from localhost ([::1]:59796 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e403d-0004q5-OO for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Oct 2017 03:43:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e403G-0004i1-PE for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 03:43:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e403D-0000Vu-MK for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 03:43:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33740) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e403D-0000Vn-I7 for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 03:43:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e403C-0007uO-T6 for bug-gnu-emacs@gnu.org; Mon, 16 Oct 2017 03:43:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Oct 2017 07:43: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.150813972730314 (code B ref 28844); Mon, 16 Oct 2017 07:43:02 +0000 Original-Received: (at 28844) by debbugs.gnu.org; 16 Oct 2017 07:42:07 +0000 Original-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 Original-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 Original-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 In-Reply-To: <83po9oh3hj.fsf@gnu.org> X-Provags-ID: V03:K0:ueJPxoqu8a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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:138502 Archived-At: > 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