All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

interface-preserving-state-p Function

Summary

The predicate for whether an interface is in "preserving-state" context.

Package

capi

Signature

interface-preserving-state-p interface => result

Arguments
interface
Values
result
nil, t, :different-invocation or :keeping-processes.
Description

The function interface-preserving-state-p returns information about whether interface is in the "preserving-state" context. An interface enters "preserving-state" context just before it is destroyed by hcl:save-current-session, and exits the context just after interface-display returns.

If the interface interface is in "preserving-state" context, then result is either t or :different-invocation. The value t means that the current invocation of LispWorks is still the same invocation. The value :different-invocation means it is a different invocation, in other words it is the saved image that is restarted.

In other circumstances interface-preserving-state-p can return :keeping-processes, which means that the interfaces are destroyed but processes that are not associated with interface are not killed. That currently happens only on Microsoft Windows when the programmer changes the arrangement of IDE windows via Preferences... > Environment > General > Window Options.

Otherwise result is nil.

interface-preserving-state-p is typically used in the destroy-callback of an interface or a pane to decide whether really to destroy the information, and in the create-callback or interface-display to decide whether the existing information can be used. Note that if it is a pane, it needs to find the top-level-interface.

Information that is made entirely of Lisp objects can be preserved in all cases. Information that is associated with external objects is invalid when the image is restarted. So when interface-preserving-state-p is used inside the create-callback or interface-display, external information can be preserved only if it returns t. When interface-preserving-state-p returns t, the external information may be preserved, unless it is tied to the lightweight process.

See also

interface
interface-display
interface-preserve-state
7.7.6 Preserving information when saving an IDE session


CAPI User Guide and Reference Manual (Macintosh version) - 01 Dec 2021 19:31:27