[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: use of special-event-map
From: |
Drew Adams |
Subject: |
RE: use of special-event-map |
Date: |
Fri, 6 May 2005 18:00:00 -0700 |
> Another question about use of `special-event-map' - consider
this code:
>
> (define-key special-event-map [iconify-frame] 'toto)
>
> (defun foo ()
> (interactive)
> (let ((binding (lookup-key special-event-map [iconify-frame])))
> (define-key special-event-map [iconify-frame] 'ignore-event)
> (iconify-frame)
> (define-key special-event-map [iconify-frame] binding)))
>
> (defun toto (event)
> (interactive "e")
> (message "TOTO"))
>
> When I try M-x foo, `toto' gets executed, even though `foo'
tries to remove
> its binding. Same thing happens if I use `nil' instead of
`ignore-event'.
>
> Explanation? Any way around this? That is, is there some way
I can inhibit
> the binding of [iconify-frame] for the duration of command foo?
(defun foo ()
(interactive)
(iconify-frame)
(while (not (input-pending-p))
(sit-for 1))
(discard-input))
Very nice! Works like a charm. Merci. - Drew
- use of special-event-map, Drew Adams, 2005/05/06
- Re: use of special-event-map, Michael Cadilhac, 2005/05/06
- RE: use of special-event-map,
Drew Adams <=
- Re: use of special-event-map, Stefan Monnier, 2005/05/08
- Re: use of special-event-map, Stefan Monnier, 2005/05/08
- Re: use of special-event-map, Stefan Monnier, 2005/05/08
- Re: use of special-event-map, Thien-Thi Nguyen, 2005/05/09