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: martin rudalics
Subject: bug#32637: 27.0.50; window-size-change-functions not run from local hook
Date: Fri, 07 Sep 2018 09:31:54 +0200

> But in bug#32536 you agreed that Man-window-size-change has to
> take care of cases where buffer-local window-size-change-functions
> needs to find all Man windows on the frame to compare their sizes
> and reformat the buffer with the minimim width from all its windows.
>
> So the window-size-change-functions hook should call the function not
> with the window as argument, but with the whole frame, as it already
> does now.  And to call the buffer-local hook only once for all
> affected windows, as it already does now (the hook has responsibility
> to find all its windows from the frame).

I meant that running 'window-size-change-functions' in a buffer-local
fashion when no window showing that buffer has changed its size might
be misleading.

But put a buffer-local function on 'window-configuration-change-hook'
and show the buffer in two windows.  The function gets called twice
with the respective window selected.  So if we implemented
'window-size-change-functions' in the same way as you suggested
earlier, you would "find all Man windows on the frame to compare their
sizes and reformat the buffer with the minimim width from all its
windows" twice.  How would you deal with that?

>> And I still think that running 'window-configuration-change-hook'
>> buffer-locally in its current from hardly makes sense either: For
>> example, we don't call it for a buffer when that buffer has been
>> removed from a window which incidentally is the case that would allow
>> Man to remove its function from 'window-configuration-change-hook'.
>
> There is no need to remove function from the buffer-local hook,
> because it is called only when the buffer is displayed
> in a window.

As you noted earlier, a buffer-local 'window-size-change-functions'
function gets called regardless of whether the buffer is shown in a
window on the frame in question.  So I suppose that's a function you
wanted to remove at least as long as we do not change the present
code.  And if we wanted to fix that, we probably need something better
than imitating 'window-configuration-change-hook'.

martin





reply via email to

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