Subject: Re: bug#73593: 29.4; desktop-save-mode does not store window configurations

From: martin rudalics <[email-masked]>
Date: Wed, 2 Oct 2024 09:41:31 +0200

> Martin, is there any practical way of preserving a
 > window-configuration across Emacs sessions?

We added window states for that purpose.

 > The object
 > current-window-configuration returns is exposed to Lisp as an opaque
 > object, and I don't think we can meaningfully serialize it, can we?

It would be very tedious to do that and the result would be something
like a window state anyway.

 > So perhaps the solution is to filter such registers from
 > register-alist when we save desktop?

This is the most reasonable way IMO.  The other two solutions would be to
optionally proceed as follows:

- Whenever we save a configuration in a register, make a shadow register
   where we save the state and use that when we save the desktop.

- When saving the desktop, temporarily restore the configuration stored
   in the register (if its frame is still live), save the state of that
   frame in a register and restore its configuration again.

For both, register.el would have to be able to handle window states.

martin