From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: use of special-event-map Date: Fri, 6 May 2005 18:00:00 -0700 Message-ID: References: <87k6mb6f4d.fsf@mahaena.lrde> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1115428555 23472 80.91.229.2 (7 May 2005 01:15:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 7 May 2005 01:15:55 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat May 07 03:15:53 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DUDuo-0000Bk-N0 for geh-help-gnu-emacs@m.gmane.org; Sat, 07 May 2005 03:15:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DUDrw-0004GU-9k for geh-help-gnu-emacs@m.gmane.org; Fri, 06 May 2005 21:12:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DUDk2-00028f-2O for help-gnu-emacs@gnu.org; Fri, 06 May 2005 21:04:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DUDjo-00021v-F4 for help-gnu-emacs@gnu.org; Fri, 06 May 2005 21:04:13 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DUDjm-0001yT-0E for help-gnu-emacs@gnu.org; Fri, 06 May 2005 21:04:10 -0400 Original-Received: from [148.87.122.32] (helo=rgminet03.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1DUDlI-0003Ir-U9 for help-gnu-emacs@gnu.org; Fri, 06 May 2005 21:05:45 -0400 Original-Received: from rgminet03.oracle.com (localhost [127.0.0.1]) by rgminet03.oracle.com (Switch-3.1.6/Switch-3.1.7) with ESMTP id j47109NZ014809; Fri, 6 May 2005 19:00:09 -0600 Original-Received: from rgmsgw301.us.oracle.com (rgmsgw301.us.oracle.com [138.1.186.50]) by rgminet03.oracle.com (Switch-3.1.6/Switch-3.1.7) with ESMTP id j47108x5014782; Fri, 6 May 2005 19:00:08 -0600 Original-Received: from rgmsgw301.us.oracle.com (localhost [127.0.0.1]) by rgmsgw301.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id j47108oj015883; Fri, 6 May 2005 19:00:08 -0600 Original-Received: from dradamslap (dhcp-amer-csvpn-gw1-141-144-64-16.vpn.oracle.com [141.144.64.16]) by rgmsgw301.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with SMTP id j47102Gl015856 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Fri, 6 May 2005 19:00:07 -0600 Original-To: "Michael Cadilhac" , X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 In-Reply-To: <87k6mb6f4d.fsf@mahaena.lrde> X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:26389 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:26389 > 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