Subject: bug#68235: 29.1.90; Switching tabs stops following process output in selected window

From: martin rudalics <[email-masked]>
Date: Fri, 16 Feb 2024 10:40:02 +0100

> One problem is that whether to run the hook is defined by the fourth argument.
 > This means that it a user needs to use the hook, there is no way to change
 > the fourth argument of the existing function calls in core commands.
 >
 > Maybe better to keep windows when the hook is not empty?
 > I.e. something like this for 'window--state-put-2':
 >
 >    (when window-state-put-keep-window-functions
 >      ...
 >      (push (list window old-buffer-or-name start-pos point-pos)
 >            window-state-put-kept-windows))

You mean to do away with the KEEP-WINDOWS argument and keep windows iff
`window-state-put-keep-window-functions' is non-nil?  This would be up
to you to decide.  Only some practice can tell what's better here.

 >> I added a new hook called 'window-state-put-keep-window-functions' with
 >> the same arguments as 'post-set-window-configuration-functions'.  Maybe
 >> people wanted to keep them apart.  If you think the hook should be also
 >> run when there are no "kept" windows, we can do that as well.
 >
 > Running the hook with an empty list of windows makes sense as well.

For some time we don't run hooks any more when windows and their buffers
change but rather wait until redisplay detects that some change occurred.
`window-state-put-keep-window-functions' already opens the backdoor to
the previous behavior so I'm not sure about opening it even further.

martin