std-save-vports, std-restore-vports


Synopsis

(std-save-vports) ; saves current viewports

(std-restore-vports <vports>) ; restores saved viewports

Description

These two complementing functions are used in error handling to save the current viewports settings on init and restore the old state on restore.

STD-SAVE-VPORTS returns a object which uniquely defines the viewports, which might be a list or a VIEWPORT symbol table name and is usable for STD-RESTORE-VPORTS only.

STD-RESTORE-VPORTS takes the object returned by STD-SAVE-VPORTS, which may be a name of a VIEWPORT symbol table or any other implementation defined object and sets the VPORTS according to this object. If the vports argument is a name and the first character is "$" then the symbol table is restored and deleted, otherwise only restored.

Both functions are normally used by the error handling pair (STD-VAR-INIT '((:VPORTS))) and (STD-VAR-RESTORE) resp. (STD-VAR-PUSH alist) and (STD-VAR-POP) if the VPORTS or any VIEWPORT changing command is used inside the user function, to save and restore the old setting, esp. on user-breaks or errors.

Example

(std-var-init '((:VPORTS)))
...
(command "'_VPORTS" ...)
...
(std-var-restore)

Arguments

vports: most likely a string, but it could be any other lisp object as well.

Return Value

STD-SAVE-VPORTS returns a viewport object which is currently a string.

The return value of STD-RESTORE-VPORTS is nil.

Side Effects

STD-RESTORE-VPORTS changes the current VIEWPORT settings.

Module

(std-require 'STDTBL)

Defined in STDTBL