bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#32637: 27.0.50; window-size-change-functions not run from local hook


From: Juri Linkov
Subject: bug#32637: 27.0.50; window-size-change-functions not run from local hook
Date: Thu, 06 Sep 2018 00:54:43 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

>> 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'

Aha, I didn't know that window-configuration-change-hook already
supports this useful feature!

> 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.

It seems what you describe is inefficiency of the current implementation,
but currently I have nothing to say about it, sorry.  What I see is that
the same logic needs to be applied to both window-configuration-change-hook
and window-size-change-functions.

All the doubts that you raised above can be solved only when these hooks
will get more usage, and you will get more reports asking for improvements.
This is one of such reports, thanks for your help!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]