Edit: ...thought pattern.
Thanks for all the discussion. It helps seeing more accomplished ppl discuss varying ideas that us lesser beings might not ever see or understand.
I did question what lines 7 and 39 were doing. Totally as an assumption/guess I took it to mean if the variable exists as line 7 states, error, because it should really be as line 39 states. I certainly didn't take into account versions or platforms beyond my simple though pattern.
J. Logan
Those lines (36, 37, 38) in Lee's code are a slightly modified version of a wonderful generic error handler skeleton ElpanovEvgeniy posted years ago. I didn't save the link but I'll paste the text below.
Essentially, what the code below does is gather up the variables and their initial values and store them in a list. This list is then evaluated later during the error handler run (very nice, clean system by ElpanovEvgeniy).
The discussion was (in a nut-shell):
Lee introduced a feature in his version. I questioned the need for that feature.
ElpanovEvgeniy's error hander:
In the beginning of function I establish a list of the necessary environment variables,
list variable always miscellaneous:
Code:
(SETQ
ERROR-LST-
'("AUTOSNAP" "OSMODE" "APERTURE" "HPSPACE" "HPASSOC"
"MIRRTEXT" "AUPREC" "LUPREC" "DIMZIN" "cecolor")
ERROR-LST- (mapcar '(lambda (a) (list 'setvar a (getvar a))) ERROR-LST-)
)
Function *error*
Code:
(defun *error* (msg)
(MAPCAR 'eval ERROR-LST-))
It is a universal *error* function *smile*