std-save-vports, std-restore-vports | ![]() |
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.
(std-var-init '((:VPORTS))) ... (command "'_VPORTS" ...) ... (std-var-restore)
vports: most likely a string, but it could be any other lisp object as well.
STD-SAVE-VPORTS returns a viewport object which is currently a string.
The return value of STD-RESTORE-VPORTS is nil.
STD-RESTORE-VPORTS changes the current VIEWPORT settings.
(std-require 'STDTBL)
Defined in STDTBL