From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: Re: Bikeshedding go! Why is unbound? Date: Tue, 18 Jan 2011 13:58:07 +0100 Message-ID: <871v4abc80.fsf@wanadoo.es> References: <4D355F3A.4040709@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1295355508 31886 80.91.229.12 (18 Jan 2011 12:58:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 18 Jan 2011 12:58:28 +0000 (UTC) Cc: emacs-devel@gnu.org To: grischka Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 18 13:58:20 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PfB8d-0005Py-Vk for ged-emacs-devel@m.gmane.org; Tue, 18 Jan 2011 13:58:20 +0100 Original-Received: from localhost ([127.0.0.1]:54094 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfB8c-0001ok-Vg for ged-emacs-devel@m.gmane.org; Tue, 18 Jan 2011 07:58:19 -0500 Original-Received: from [140.186.70.92] (port=46779 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfB8X-0001oR-H0 for emacs-devel@gnu.org; Tue, 18 Jan 2011 07:58:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfB8V-0002ug-MU for emacs-devel@gnu.org; Tue, 18 Jan 2011 07:58:13 -0500 Original-Received: from impaqm1.telefonica.net ([213.4.138.17]:59378 helo=telefonica.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfB8V-0002td-DB for emacs-devel@gnu.org; Tue, 18 Jan 2011 07:58:11 -0500 Original-Received: from IMPmailhost2.adm.correo ([10.20.102.39]) by IMPaqm1.telefonica.net with bizsmtp id wvcc1f00x0r0BT6010y8AM; Tue, 18 Jan 2011 13:58:08 +0100 Original-Received: from qcore ([88.13.104.24]) by IMPmailhost2.adm.correo with BIZ IMP id x0y71f00e0XbiK41i0y7Uw; Tue, 18 Jan 2011 13:58:08 +0100 X-Brightmail-Tracker: AAAAAA== X-original-sender: 981711563@telefonica.net In-Reply-To: <4D355F3A.4040709@gmx.de> (grischka's message of "Tue, 18 Jan 2011 10:36:58 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:134699 Archived-At: grischka writes: >> This is unnecesary. The Windows event loop coded into Emacs already >> receives Alt-F4 in a single event. What is needed is to determine from >> that event loop if there is a binding for Alt-F4 (created with *-set-key >> etc). Once we know that there is no such binding, it is trivial to send >> back the Alt-F4 event back to Windows. > > Well, it would be difficult to determine on the Windows level whether > the single keystroke was maybe part of C-x M-f4 or C-h M-f4. So in > any case it is better to reuse emacs central event parser. This is unnecesary too. Alt-F4 must work irrespectively of the prefix keys typed so far: if you type C-x or C-h and then click on the Close button on the top right of the frame, Emacs thinks you want to exit the application. Alt-F4 must have the same effect as clicking that button (when M-f4 is unbound on Emacs, hence the need for checking the binding from the Windows event loop). > To make some suggestion that could work: Store the key-code in a > variable like this: > > case WM_SYSKEYDOWN: > last_syskey_code = wParam; > ... > > define keys emacs-wise like this: > > (global-set-key [M-f4] 'w32-syskey) If we go that route why not just bind M-f4 to a function that closes the current frame, as suggested at the beginning of this thread? [snip]