[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Catching cancel of window-r



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))))