Subject: Re: bug#10348: 24.0.92; Save and load window states

From: Stefan Monnier <[email-masked]>
Date: Fri, 23 Dec 2011 19:07:01 -0500

>>> (1) Do not save the `clone-of' parameter.  It's not yet useful anyway.
>>> This will not solve the more general problem mentioned above.
>> As mentioned, it's not a really convincing solution.
> It would allow us to silently ignore this problem until 24.2.  And it
> would obviously allow Michael to go on with his work.  His feedback
> would be overly welcome here.

No, it would address this particular bug-report, but similar problems
may reappear at any time.

> IIUC this is what desktop does.  The problem is rather that we would
> have to distinguish between values needed for intra-session purposes and
> those that make sense for inter-session purposes too.

I'm not sure distinguishing the two is needed (especially for
window-state-*).

>>> Unless you have a better suggestion I'll apply (1) for Emacs 24.1 and
>>> try to propose a combination of (3) and (4) for later releases.
>> I think the best course of action is to only save the window
>> parameters listed in some variable (window-state-saved-parameters?).
> You mean that anyone who misuses that variable (by including, for
> example, a parameter that actually stores a window object as value)
> would be on her own?

I don't see any harm in it.

> Doesn't look so attractive to me since the effect will only be seen in
> a new session, some time after the problematic save happened.

Not if we make this variable specify which parameters to include in
window-states, rather than only which parameters to write to a file.
Or maybe I don't understand the problem you're referring to.

>> Actually, it might even be good to filter which params to keep not just
>> when saving but already when constructing the window-state object (some
>> params may simply not belong in a window-state object because restoring
>> them would make no sense).
> Agreed.

>> After all the window-configurations don't save&restore
>> window parameters.
> Currently they do (unless you modify them destructively).  Otherwise,
> side windows and atomic windows won't work.

Oh, I see that's another change in Emacs-24.  It's actually problematic
because set-window-parameter does operate destructively, so it makes the
semantics rather irregular.

        Stefan