;;AUTOLOAD: store-error-name
;;AUTODOC: store-error-name "stores last error name"
;; (store-error-name flag)
;;
;; if flag is non-nil, remembers all errors in the variable *last-error-name*
;; calling (store-error-name ()) disable this feature
;; example:
;; (store-error-name t)
;; ? (/ 45 0) 
;; Error: Division by zero on 45
;; ? *last-error-name*
;; = Errors:DivideByZero

(defun store-error-name-handler (errname &rest args)
  (setq *last-error-name* errname)
  :nil
)

(defun store-error-name (flag)
  (if flag
    (if (not (seek *error-correctors* store-error-name-handler))
      (lappend *error-correctors* store-error-name-handler)
    )
    (if (seek *error-correctors* store-error-name-handler)
      (delete-item *error-correctors* store-error-name-handler)
    )
  )
)

