From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Rankin Newsgroups: gmane.emacs.bugs Subject: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook Date: Sun, 15 Oct 2017 23:27:53 +1000 Message-ID: <1508074073.3557079.1139314312.4BFE5BC2@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> 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 1508074095 3953 195.159.176.226 (15 Oct 2017 13:28:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 15 Oct 2017 13:28:15 +0000 (UTC) Cc: 28844@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 15 15:28:11 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 1e3ixb-0008WO-On for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Oct 2017 15:28:08 +0200 Original-Received: from localhost ([::1]:57302 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3ixj-0000Z5-4S for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Oct 2017 09:28:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36934) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3ixb-0000Yw-1g for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 09:28:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3ixW-00053N-H3 for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 09:28:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60610) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e3ixV-00052o-Ss for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 09:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e3ixV-0004b6-Nx for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2017 09:28:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Rankin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Oct 2017 13:28: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.150807407617652 (code B ref 28844); Sun, 15 Oct 2017 13:28:01 +0000 Original-Received: (at 28844) by debbugs.gnu.org; 15 Oct 2017 13:27:56 +0000 Original-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 Original-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 Original-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) Original-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: Original-Received: by mailuser.nyi.internal (Postfix, from userid 99) id 081B59E2EE; Sun, 15 Oct 2017 09:27:53 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface - ajax-26fdae60 In-Reply-To: <59E350AE.3060005@gmx.at> 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:138453 Archived-At: 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...