From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: use of special-event-map
Date: Fri, 6 May 2005 18:00:00 -0700 [thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICEELOCHAA.drew.adams@oracle.com> (raw)
In-Reply-To: <87k6mb6f4d.fsf@mahaena.lrde>
> 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
next prev parent reply other threads:[~2005-05-07 1:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.3810.1115425040.2819.help-gnu-emacs@gnu.org>
2005-05-07 0:42 ` use of special-event-map Michael Cadilhac
2005-05-07 1:00 ` Drew Adams [this message]
[not found] <mailman.4149.1115600512.2819.help-gnu-emacs@gnu.org>
2005-05-09 2:12 ` Stefan Monnier
2005-05-09 12:33 ` Thien-Thi Nguyen
[not found] <mailman.4143.1115595521.2819.help-gnu-emacs@gnu.org>
2005-05-08 23:58 ` Stefan Monnier
2005-05-09 0:50 ` Drew Adams
2005-05-09 18:12 ` Kevin Rodgers
[not found] <mailman.4129.1115586334.2819.help-gnu-emacs@gnu.org>
2005-05-08 22:40 ` Stefan Monnier
2005-05-08 23:35 ` Drew Adams
2005-05-06 18:32 Drew Adams
2005-05-06 23:56 ` Drew Adams
2005-05-08 20:53 ` Drew Adams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DNEMKBNJBGPAOPIJOOICEELOCHAA.drew.adams@oracle.com \
--to=drew.adams@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).