+
+(defun call-hooks (kind hooks &key (on-error :error))
+ (dolist (hook hooks)
+ (handler-case
+ (funcall hook)
+ (serious-condition (c)
+ (if (eq :warn on-error)
+ (warn "Problem running ~A hook ~S:~% ~A" kind hook c)
+ (with-simple-restart (continue "Skip this ~A hook." kind)
+ (error "Problem running ~A hook ~S:~% ~A" kind hook c)))))))