[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Catching cancel of window-r
- To: "Don Mitchell" <dhm%proact@uunet.UU.NET>
- Subject: Re: Catching cancel of window-r
- From: bill@cambridge.apple.com (Bill St. Clair)
- Date: Fri, 6 Aug 1993 16:18:16 -0600
- Cc: info-mcl
At 10:27 AM 8/6/93 -0600, Don Mitchell wrote:
>Subject: Catching cancel of window-revert
>>From my tests, it does not appear that window-revert throws to
>cancel when the user presses cancel nor return a different value.
>How can I write an around method for window-revert that only
>executes the latter part if the user did not hit cancel in the primary
>method?
You are correct that window-revert does not throw to cancel when you
press the cancel button. It should. If you really want it,
I'll make a patch (I've changed it in my MCL 3.0 sources). The other
way to tell if the revert was cancelled is to check for a change in
the buffer-modcnt:
(defmethod window-revert-or-cancel ((w fred-mixin))
(let* ((buf (fred-buffer w))
(modcnt (buffer-modcnt buf)))
(window-revert w)
(when (eql modcnt (buffer-modcnt buf))
(cancel))))