[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Condition Question
- To: cartier@math.uqam.ca (Guillaume Cartier)
- Subject: Re: Condition Question
- From: kab (Kim Barrett)
- Date: Tue, 21 Jul 92 12:35:45 EST
- Cc: info-mcl@cambridge.apple.com (Macintosh Common Lisp)
> I am developing a progress reporting module that
> enables one have a window showing progress while doing
> some computations. The progress window behaves exactly like
> the system 7 finder's file copy window. It doesn't keep
> you from switching application, etc...
>
> Everything work fine except if an error occurs.
> If an error occurs, I would need to be able to do the following:
>
> Before going to the debugger,
> - reenable MCL's menus
> - hide the progress window
>
> If the error is continued from
> - redisable MCL's menus
> - show the progress window
This looks like a job for *debugger-hook* and invoke-debugger. Making up some
names as I go along, perhaps something like the following will do what you
want.
... in the expansion for with-progress-reporting-context (I made up this name)
(let* ((old-hook *debugger-hook*)
(new-hook #'(lambda (c h)
(declare (ignore h))
(let ((*debugger-hook* old-hook))
(without-progress-reporting-context ;made up name
(invoke-debugger c)))))
(*debugger-hook* new-hook))
(declare (dynamic-extent new-hook))
...