Subject: bug#32850: 27.0.50; window-swap-states doesn't swap window prev/next-buffers

From: Juri Linkov <[email-masked]>
Date: Tue, 23 Oct 2018 23:45:34 +0300

> 'set-window-configuration' writes directly into the window structure
> while 'window-state-put' splits windows instead which is much slower
> and at the very least messes up window identities.

This means that window configurations still the most suitable
within the confines of the same session.  And indeed trying to eval:

(add-hook 'window-size-change-functions
          (lambda (_) (message "window-size-change-functions called")))

(window-state-put
 (window-state-get (frame-root-window (selected-frame)) 'writable)
                   (frame-root-window (selected-frame)) 'safe)

(set-window-configuration (current-window-configuration))

you can see that window-state-put wrongly calls the hook
window-size-change-functions whereas set-window-configuration
doesn't call it that is the correct behavior.

Then we desperately need functions that will serialize window
configurations to writable window states to save them in the
desktop file.