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

From: martin rudalics <[email-masked]>
Date: Sat, 13 Jan 2024 16:02:32 +0100

> So we'd need a persistent window parameter
 >
 > (1) whose value is set to dired's file name at point in
 > 'current-window-configuration'
 >
 > (2) and allows to restore the window's point appropriately in
 > 'set-window-configuration'.

I now think that we need two or three hooks:

- 'pre-current-window-configuration-functions', an abnormal hook that
   receives one argument - the frame whose configuration shall be
   recorded.  'dired' has to set a persistent window parameter, for each
   window on that frame it uses, whose value is whatever is needed to
   restore the present state of the buffer in that window.

- 'pre-set-window-configuration', an abnormal hook that receives one
   argument - the frame whose configuration is about to be restored.
   'dired' would have to save away its parameter values of all windows
   it currently owns on that frame.

- 'post-set-window-configuration-functions', an abnormal hook that
   receives one argument - the frame whose configuration was just
   restored.  'dired' would have to examine its persistent parameters of
   all windows on that frame and restore the previous state for them
   unless maybe a parameter in 'pre-set-window-configuration' tells it
   not to do that.

The latter would be responsible for resolving conflicts like what to do
when the same dired buffer is shown in the selected window of the saved
and current configuration but their points are on different file names.
Whether 'pre-set-window-configuration' is really need for that or some
simpler approach would suffice is something I can't tell yet.  Also
considering the case where the same directory is shown in a non-selected
window with saved and current points on different file names and the
saved name's file has been deleted meanwhile.

For dired the value to save in a parameter would at least be that of the
file name point is on - maybe also the number of that line.  It's
completely up to the major mode like 'dired' to store there whatever it
wants.

martin