Subject: Re: bug#69093: window-state-put doesn't update current buffer

From: martin rudalics <[email-masked]>
Date: Fri, 23 Feb 2024 09:48:05 +0100

>> If by "fails" you mean that something in ‘window-state-put’ makes the
 >> selected window not show the current buffer, we have to dig further.
 >
 > The window state already has information about the selected window:
 >
 >    (selected . t)

I forgot.  If the selected window is part of the saved state, this is
set.

 > 'window-state-put' fails to select the previously selected
 > window's buffer with the property (selected . t).

It should have selected it here

		;; Select window if it's the selected one.
		(when (cdr (assq 'selected state))
		  (select-window window))

Please first check whether this 'select-window' call is executed at all
in your scenario.  If it is, please find out which window apparently
gets selected instead afterwards and try to find out why.  If there's no
clue, you would have to find out who undoes that selection first by
putting a breakpoint into Fselect_window and, if that fails, by putting
a breakpoint into select_window (which can be a pain).

martin