std-save-layer, std-restore-layer


Synopsis

(std-save-layer <layer-name>) ; => layer-state

(std-restore-ucs <layer-state>) ; restores saved layer state

Description

These two complementing functions are used in error handling to save the state of a layer on init and restore the old state on restore.

STD-SAVE-LAYER returns a layer-state object for the given layer only. The return value may be used for std-restore-layer.

STD-RESTORE-LAYER takes the layer-state object which must be the layer-state object returned by std-save-layer and changes the layer properties of the specified layer according to this object. The layer-state object completely describes a LAYER entity. The layer might bepurged, created, turned on, off, frozen, thawed, locked, unlocked, changed it's color, aso.

Both functions are normally used by the error handling pair (STD-VAR-INIT '((:LAYER name))) and (STD-VAR-RESTORE) resp. (STD-VAR-PUSH alist) and (STD-VAR-POP), to restore the previous setting on user-breaks or errors.

Example

(std-var-init '((:LAYER "ROOM")))
...
(command "'_LAYER" "_OFF" "ROOM" ""))
...
(std-var-restore)

Arguments

layer-state: a layer-state object, which might be a list.

Return Value

STD-SAVE-LAYER returns a layer-state object.

The return value of STD-RESTORE-LAYER is undefined.

Side Effects

STD-RESTORE-LAYER may change the properties of the given layer.

Module

(std-require 'STDTBL)

Defined in STDTBL