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

Re: with-cursor



>(with-cursor *watch-cursor* body)
>macro-expands to 
>(let ((*cursorhook* *watch-cursor*)) (update-cursor) body)
>not something like:
>(progn (let ((*cursorhook* *watch-cursor*)) 
>         (update-cursor) body)
>       (update-cursor))
>
>My main question is how does this work ever? What triggers resetting the
>cursor in the cases where it is reset?

from MCL sources "level-1;events.lisp"

; Default method justs updates cursor
(defmethod window-null-event-handler (w)
  (declare (ignore w))
  (update-cursor))

So, window-null-event-handler does an (update-cursor) and the cursor is
_eventually_ restored. I have wondered why the macro is this way also; we
have a problem where if a gc occurs during a long operation, the gc's
with-cursor does not appear to restore our watch cursor since we're not
processing events.

e