The best policy for you error handler (after making sure it's localized) would be to check and make sure the the variable has a value before trying to set a variable with said value.
eg.
At some point in time in the routine.
- (setq OldCmdecho (getvar 'cmdecho))
In your error handler, you would check before trying to set with:
- (if OldCmdecho (setvar 'cmdecho OldCmdecho))
or
- (and OldCmdecho (setvar 'cmdecho OldCmdecho))
Both will check the variable before trying to set with it.
There are other fancier ways, but these are the simplest. |