emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r106873: Provide persistent windo


From: martin rudalics
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r106873: Provide persistent window parameters.
Date: Mon, 16 Jan 2012 18:58:04 +0100

> The issues aren't quite fresh in my memory, but IIRC the three cases we
> need are "never save", "always save" and "only save for intra-session
> restore because it can't be saved to disk".
> But the above seems to do the reverse, i.e. it provides a "only save
> inter-session but not intra-session", which is rather weird.  IOW, I'd
> have expected the meaning of `state' to be the opposite (save for
> current-window-configuration or when `ignore' is non-nil, but not when
> ignore is nil since it may un`read'able).
> Am I missing something?

By default we don't save parameters that is, we don't include them in
`window-persistent-parameters'.  This should be the "never save" case
you mentioned above.  Now about those saved as described in the manual:

    `state'
          This value means the parameter is saved by `window-state-get'
          provided its IGNORE argument is `nil'.  The function
          `current-window-configuration' does not save this parameter.

This is a special case necessitated by the following observation: A
"never save" parameter, once installed, modified or not within a
`save-excursion', will be still present after we leave the excursion
since the old window is restored and its parameters are not reset.

This won't hold for a window state based application since
`window-state-put' creates new windows without parameters.  A typical
example is the `clone-of' parameter which I want to ignore ("never
save") within the window configuration framework but which wouldn't make
any sense if not installed by `window-state-put'.

    `nil'
          This value specifies that the parameter is saved by
          `current-window-configuration' and, provided its IGNORE
          argument is `nil', by `window-state-get'.

This is the "only save for intra-session restore because it can't be
saved to disk" type.

    `t'
          This means that the parameter is saved unconditionally by both
          `current-window-configuration' and `window-state-get'.  This
          value should not be used for parameters whose values do not
          have a read syntax.  Otherwise, invoking `window-state-put'
          in another session may fail with an `invalid-read-syntax'
          error.

This is the "always save" case.

Implicitly t => nil => state (or t \subseteq nil \subseteq state) holds.
Hence, a parameter saved on disk is also saved by configurations and by
intra-session states.  A parameter saved by configurations is also saved
by intra-session states.  Whether a state shall be saved for inter- or
intra-session purposes is indicated by the IGNORE argument of
`window-state-get'.  If it's non-nil, we want inter-session saving.

So the "only save inter-session but not intra-session" case hopefully
doesn't exist.  Any inter-session parameter (a `t' parameter) is saved
everywhere.  OTOH a `state' parameter is saved by intra-session (IGNORE
nil) `window-state-get' only.  `nil' parameters are saved intra-session
but not inter-session.

But maybe I'm missing something.  Is the documentation that bad?

martin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]