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: use of special-event-map Date: Fri, 6 May 2005 11:32:18 -0700 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1115404643 25805 80.91.229.2 (6 May 2005 18:37:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 6 May 2005 18:37:23 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 06 20:37:20 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DU7gf-0008Jg-K5 for geh-help-gnu-emacs@m.gmane.org; Fri, 06 May 2005 20:36:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DU7oR-0003Ar-7g for geh-help-gnu-emacs@m.gmane.org; Fri, 06 May 2005 14:44:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DU7fc-0005ls-54 for help-gnu-emacs@gnu.org; Fri, 06 May 2005 14:35:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DU7fX-0005h8-Dp for help-gnu-emacs@gnu.org; Fri, 06 May 2005 14:35:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DU7fT-0005cF-Oi for help-gnu-emacs@gnu.org; Fri, 06 May 2005 14:35:19 -0400 Original-Received: from [141.146.126.231] (helo=agminet04.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1DU7hw-0004qR-DJ for help-gnu-emacs@gnu.org; Fri, 06 May 2005 14:37:52 -0400 Original-Received: from agminet04.oracle.com (localhost [127.0.0.1]) by agminet04.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id j46IWLXE016505 for ; Fri, 6 May 2005 13:32:21 -0500 Original-Received: from rgmsgw301.us.oracle.com (rgmsgw301.us.oracle.com [138.1.186.50]) by agminet04.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id j46IWKv5016445 for ; Fri, 6 May 2005 13:32:21 -0500 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 j46IWKlm029218 for ; Fri, 6 May 2005 12:32:20 -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 j46IWJ4P029204 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Fri, 6 May 2005 12:32:19 -0600 Original-To: "Help-Gnu-Emacs" 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 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:26385 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:26385 In a different thread, Stefan suggested: to catch the "press the delete button in the WM", ...change the binding for the delete-frame event in special-event-map (defaults to handle-delete-frame). Cool. I didn't know about `special-event-map'. I tried this: (defun foo-on-event (event) (interactive "e") (let ((frame (posn-window (event-start event)))) (foobar frame))) (define-key special-event-map [iconify-frame] 'foo-on-event) This works, in the sense that `foo-on-event' is executed whenever you click the window-manager `iconify' (minimize) button. However, `foo-on-event' is executed after the frame is in fact iconified (by the window manager). I can deiconify the frame in the `foo-on-event' code, but the result is that when you click the minimize button the frame is first iconified, then deiconified, then the rest of the `foo-on-event' behavior (foobar) occurs. Suggestions? Any way to intercept (i.e. prevent) the window-manager's minimization of the frame? FYI - I'm using Windows XP, in case it's relevant.