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#32637: 27.0.50; window-size-change-functions not run from local hook Date: Wed, 05 Sep 2018 09:47:24 +0200 Message-ID: <5B8F8A0C.1030908@gmx.at> References: <87musx9dr1.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1536133598 19251 195.159.176.226 (5 Sep 2018 07:46:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 5 Sep 2018 07:46:38 +0000 (UTC) To: Juri Linkov , 32637@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 05 09:46:34 2018 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 1fxSWF-0004p0-Pd for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Sep 2018 09:46:31 +0200 Original-Received: from localhost ([::1]:54329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxSYM-0004FP-AG for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Sep 2018 03:48:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxSXp-0003u9-LC for bug-gnu-emacs@gnu.org; Wed, 05 Sep 2018 03:48:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fxSXk-0003TF-6v for bug-gnu-emacs@gnu.org; Wed, 05 Sep 2018 03:48:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41309) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fxSXj-0003SS-96 for bug-gnu-emacs@gnu.org; Wed, 05 Sep 2018 03:48:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fxSXj-0006R6-75 for bug-gnu-emacs@gnu.org; Wed, 05 Sep 2018 03:48: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: Wed, 05 Sep 2018 07:48:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32637 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32637-submit@debbugs.gnu.org id=B32637.153613366424674 (code B ref 32637); Wed, 05 Sep 2018 07:48:03 +0000 Original-Received: (at 32637) by debbugs.gnu.org; 5 Sep 2018 07:47:44 +0000 Original-Received: from localhost ([127.0.0.1]:46319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxSXQ-0006Pt-4S for submit@debbugs.gnu.org; Wed, 05 Sep 2018 03:47:44 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:43579) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fxSXN-0006Pf-69 for 32637@debbugs.gnu.org; Wed, 05 Sep 2018 03:47:42 -0400 Original-Received: from [192.168.1.101] ([46.125.250.92]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LdZAI-1fWPG21Zbe-00ijpa; Wed, 05 Sep 2018 09:47:32 +0200 In-Reply-To: <87musx9dr1.fsf@mail.linkov.net> X-Provags-ID: V03:K1:ZafXmXlasCbGe8cVTlY/4sJRaJ0kYgv7ujBK2LK6bDGS0HHFbQT IlwPu9zaaiqzvu+GgZwrdHkLMkG3HVKTfgw/PagJEC4gTqQth+khLQglXyxJAuAuxK2VlxE 0Iffn1dGz4ttFyB/3zsvSa1LUxO6ApQWFEOe69zC9ZqVkURk9ls5gpI8O1OSNGE5s0THw0j WcXXRfbLOcawCABeQrhXQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:PIwS0C7lXvs=:vG/w22qIqCNYuzshKb9ihh UyaSud5bnduEwFHsyxY3bTuFrrreowY5IQP8OhVbm+EQ7tw50mbLFnK537ENkXuFsJutJET9r h3EHqz6Q1oxkMYXPbB+/zv9RtiB3z05gTnfJoACpzUMmJhb2FSHx02y+0BTH0EZlp9JVjr/6b 54yFWEclFKliZbds+kjU7uetWCN43okPMqFgLIELL7WRAtgPEPWAGqX614JrFrezHOuC6BBJU xejSpbX2P8hAiaOwZgDaWjy2sAFTxDUcuARrSvFn2bMjU+eLht20ucoeYuYPjd0qrLNzZaRHg CDC/06bHnen0l8vtPGnWvYeP9Q47i8Lnnc6xzb6cBqDFh5JWumVZVgdmSbZZ7CbJkDiVvmPt8 S6PfMb+vO0C3W7Aqhr9lbcCO25RbzP5+dg3/7OnilWk3omMEaBIbWv6pW7uAciKtlqi7OMgYY 1JT+wRWueAji+EHdbYKaFRIXo6hnow0lUl1zw4CmU4WWHFWhBmlOj1lH1z9ruMYtXpB1zQW9d Igsv6HNE1lh9IaRlGw2YmgwnvDQWWdvACQBulxw4BpmjgO+53kVFPz+kX8AEDRYtyFwpPLvY2 iQ+wlitr94FhxLVK1zQAXV3TSIcm8xWuOyYycTf5NO/JRvS3R8yvpnBU+jqBFbJ7xcIOwIMlb ihIyc1plfJL18sgGrVVX4ed4DH/3iGPYf2vol7BaxKIbE0MhsxmwrKwFgZeRMANkDEZHHwws6 DnaRtSU83khtNCoYyZEPkgxD6DWv5yIdF8CbWCwBCa1tcb7ed7KQUHQlZn05rQE4Xj2jARr2 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:150038 Archived-At: > 0. In emacs -Q open two windows: one with the *scratch* buffer, > another window with the *Messages* buffer with e.g. =E2=80=98C-h e=E2=80= =99 > (view-echo-area-messages). > > 1. In *scratch* eval: > > (add-hook 'window-size-change-functions > (lambda (frame) (message "%S" frame)) > nil t) > > 2. Resize windows with e.g. =E2=80=98C-x {=E2=80=99 (shrink-window-hor= izontally) > Check the message with the frame name in *Messages*, fine. > > 3. Select the window with *Messages* with =E2=80=98C-x o=E2=80=99 (oth= er-window), > and resize again =E2=80=98C-x }=E2=80=99 > > No message in *Messages*, because the hook was not called, > but actually the size of the *scratch* buffer was changed. > > window-size-change-functions needs to notify the buffer > that requested such notifications via this hook. This is a legitimate request but I'm not sure whether we should do that for two reasons: The first reason is that we already run a buffer-local part of 'window-configuration-change-hook' and I dislike it. Selecting a window and making its buffer current for the sake of running a hook is a bad idea IMO because both, selected window and current buffer, are vital informations and a function run by a hook should be aware of them. Worse even, we already make the selected window's buffer current first which might defeat the expectations of a function run by the global hook. Also the window in question might not have changed at all. The thing that did change is the window configuration of a frame and it would be much more interesting if the hook told me what really has changed instead of telling me that a buffer's window might have changed. The second reason is a purely technical one: We'd have to walk the window tree to find out which buffer may have been affected. However, the function run by the local hook would still have to find out which window(s) shouwing the buffer was (were) potentially affected. This means that the buffer-local function would have to walk the window tree a second time anyway. But I admit that from the application programmer's POV the behavior you ask for might be convenient, so patches are welcome. See the code of run_window_configuration_change_hook in window.c for how to do that but please do _not_ introduce any side effects when running the global 'window-size-change-functions'. martin