Subject: bug#29050: 26.0; Change in when `window-configuration-change-hook' is run

From: martin rudalics <[email-masked]>
Date: Sun, 29 Oct 2017 12:19:03 +0100

>   *** Resizing a frame no longer runs 'window-configuration-change-hook'.
 >   'window-size-change-functions' should be used instead.
 >
 > Previously you could have a hook on 'window-configuration-change-hook'
 > that would take effect for frame resizings.  Now you cannot.
 >
 > Perhaps someone thought that just telling users to use
 > 'window-size-change-functions' instead would suffice.  No.  That hook
 > (which already existed, and which was fine as it was) is for ABNORMAL
 > hooks.  This incompatible change means that you cannot use the same,
 > NORMAL hook for both'window-configuration-change-hook' and
 > 'window-size-change-functions'.
 >
 > So if you want the behavior you had before, i.e., you want a function to
 > be invoked for both kinds of changes, you are out of luck.  You need to
 > have two different functions, or you need to at least change the
 > function to accept a frame argument, even if it is not used.  Why?

In earlier Emacsen, changing the frame size was allowed to delete all
windows but the selected one.  Nowadays, changing the frame size does
not delete windows any more and so does no more change the window
configuration proper but only the sizes of individual windows.

'window-configuration-change-hook' is a quite expensive hook which is
run for way too many functions in the windows area.  It's expensive
because it's run for every single invocation of these functions and
often even if nothing had changed at all.  I plan to run it exclusively
for the following cases - window deletion and creation and displaying a
different buffer in a window - which are all real changes.  Any window
resizing is covered by ‘window-size-change-functions’ which is now run
(almost) only when the size of a window really changed.

martin