Hey all!
The common practice is to use :
(setq TempErr *ERROR*) to store the current error trap in a variable for restoring it at the end of the function.
And then use (setq *ERROR* CurrErrTrap) to point to the new error trap, which is defined elsewhere.
I've been playing around with defining functions inside of other functions, and one of the things I tried was defining an *ERROR* function inside of another function, and adding *ERROR* to the scoped variable list. It seems to me that this gets around needing to use a temporary variable and needing to ensure that it gets reset at the end.
Am I missing something? or is this actually clever?