From: "Óscar Fuentes" <ofv@wanadoo.es>
To: emacs-devel@gnu.org
Subject: Re: Bikeshedding go! Why is <M-f4> unbound?
Date: Sat, 15 Jan 2011 01:07:26 +0100 [thread overview]
Message-ID: <8762trc9mp.fsf@wanadoo.es> (raw)
In-Reply-To: jwvlj2n8pfx.fsf-monnier+emacs@gnu.org
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> It sounds like the 'correct' thing to do is is to call
>> let_Windows_process_it() whenever any "<foo-key> is undefined" message
>> is reported.
>
> Yes, that's another way to attack the problem. And it would make sense.
If you insist on working at the C level, just handle Alt-F4 as if it
were WM_CLOSE:
swich(event) {
...
case WM_KEYDOWN:
if( key is Alt-F4 and is unbound )
do the same as WM_CLOSE
I have no idea how complex is to check from w32term.c if a key is bound.
I can't see why just adding something like
(global-set-key [M-f4] 'delete-frame-maybe-exit-emacs)
is wrong.
>> The question of how difficult that would be to do is another matter.
>
> Indeed, there are several potential difficulties:
> - the time when "<foo-key> is undefined" is run can be much later than
> when we received the key event from Windows (some other events may
> have been received in the mean time already, for example), so that
> might cause extra difficulties.
> - when we get to "<foo-key> is undefined", the event has been remapped
> a few times, so it can be far from obvious how to turn the resulting
> Elisp event and turn it back into its original Windows event (tho,
> we normally have access to the raw (un-remapped) Elisp event, so some
> of that work is done).
>
> A simpler solution is to dump the problem onto the user: setup
> a `w32-passthrough-events' where the user can specify events that should
> be passed on to Windows's standard lib rather than handled by Emacs.
This is overkill. There are just a few candidates for "events that Emacs
receives but maybe are worth delegating to Windows". One is Alt-F4,
another Ctrl-Space (which activates the application's system menu) Maybe
there is some other. Not worth the trouble, IMO.
> But it still leaves open the question whether it should contain M-f4 or
> A-f4 (or use yet-another event representation),
Is there an [A-f4] key event on Emacs running on Windows? I mean, I've
never seen one. My keyboard says "Alt" but whenever I use that modifier,
Emacs says [M-whatever].
> as well as what happens
> when the user hits C-x M-f4.
That's simple: Alt-F4 is the same as clicking on the window's close
button, so do the same as C-x <click close button>. Hmmm, I see, maybe
that's not possible from Lisp.
next prev parent reply other threads:[~2011-01-15 0:07 UTC|newest]
Thread overview: 121+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-05 14:48 Bikeshedding go! Why is <M-f4> unbound? Deniz Dogan
2011-01-05 15:29 ` Óscar Fuentes
2011-01-05 17:11 ` Deniz Dogan
2011-01-05 17:30 ` Eli Zaretskii
2011-01-05 17:36 ` Deniz Dogan
2011-01-05 18:15 ` Óscar Fuentes
2011-01-09 22:00 ` Lennart Borgman
2011-01-10 1:01 ` Drew Adams
2011-01-10 1:46 ` Lennart Borgman
2011-01-10 3:01 ` Drew Adams
2011-01-10 3:08 ` Lennart Borgman
2011-01-12 13:53 ` Stuart Hacking
2011-01-12 15:01 ` Drew Adams
2011-01-12 15:54 ` Deniz Dogan
2011-01-12 17:17 ` Drew Adams
2011-01-12 20:29 ` Chad Brown
2011-01-12 20:32 ` Stefan Monnier
2011-01-12 20:42 ` Deniz Dogan
2011-01-13 2:42 ` Stefan Monnier
2011-01-13 3:13 ` Lennart Borgman
2011-01-13 3:59 ` Óscar Fuentes
2011-01-13 4:15 ` Lennart Borgman
2011-01-13 13:13 ` Óscar Fuentes
2011-01-13 16:57 ` Stefan Monnier
2011-01-13 18:05 ` Óscar Fuentes
2011-01-13 21:15 ` Stefan Monnier
2011-01-13 22:00 ` Lennart Borgman
2011-01-14 0:12 ` Jason Rumney
2011-01-14 0:21 ` Lennart Borgman
2011-01-14 5:02 ` Jason Rumney
2011-01-14 8:28 ` Lennart Borgman
2011-01-13 22:18 ` Drew Adams
2011-01-13 22:30 ` Lennart Borgman
2011-01-13 22:47 ` Drew Adams
2011-01-13 23:04 ` Óscar Fuentes
2011-01-13 23:14 ` Lennart Borgman
2011-01-14 9:25 ` Giorgos Keramidas
2011-01-14 9:43 ` Lennart Borgman
2011-01-13 22:53 ` Stuart Hacking
2011-01-13 23:10 ` Lennart Borgman
2011-01-14 0:13 ` Jason Rumney
2011-01-14 1:35 ` Drew Adams
2011-01-14 5:08 ` Jason Rumney
2011-01-14 10:49 ` PJ Weisberg
2011-01-14 15:21 ` Lennart Borgman
2011-01-14 15:48 ` Stefan Monnier
2011-01-15 0:07 ` Óscar Fuentes [this message]
2011-01-15 11:41 ` Lennart Borgman
2011-01-16 21:49 ` Drew Adams
[not found] ` <227F94B0AC1649C1A41082A24!9921783@us.oracle!! ! .com>
[not found] ` <227F94B0AC1649C1A41082A24! 9921783@us.oracle! .com>
[not found] ` <227F94B0AC1649C1A41082A24!9921783@us.oracle!! .com>
2011-01-16 23:53 ` Lennart Borgman
2011-01-17 1:40 ` Drew Adams
2011-01-17 1:52 ` Drew Adams
2011-01-17 8:32 ` Lennart Borgman
2011-01-17 18:22 ` Drew Adams
2011-01-17 18:36 ` Lennart Borgman
2011-01-17 19:02 ` Drew Adams
2011-01-17 19:27 ` Lennart Borgman
2011-01-18 3:20 ` Bikeshedding "user choice" Stephen J. Turnbull
2011-01-18 5:29 ` Drew Adams
2011-01-18 6:11 ` Stephen J. Turnbull
2011-01-18 17:45 ` Drew Adams
2011-01-19 4:59 ` Stephen J. Turnbull
2011-01-19 19:34 ` Drew Adams
2011-01-18 8:06 ` Bikeshedding go! Why is <M-f4> unbound? jasonr
2011-01-17 19:27 ` Óscar Fuentes
2011-01-17 20:24 ` Drew Adams
2011-01-17 2:27 ` Jason Rumney
2011-01-17 18:21 ` Drew Adams
2011-01-16 21:49 ` Drew Adams
2011-01-14 17:58 ` Drew Adams
2011-01-14 20:27 ` Lennart Borgman
2011-01-14 22:24 ` Drew Adams
[not found] ` <D727BC7268A24AF7B9544FD4E0B74E11@us! .oracle.com>
2011-01-14 22:43 ` Lennart Borgman
2011-01-16 21:49 ` Drew Adams
2011-01-16 23:49 ` Lennart Borgman
2011-01-17 0:33 ` Philipp Haselwarter
2011-01-17 1:41 ` Drew Adams
2011-01-17 1:45 ` Drew Adams
2011-01-17 8:29 ` Lennart Borgman
2011-01-17 8:47 ` Stephen J. Turnbull
2011-01-17 9:23 ` Lennart Borgman
2011-01-17 18:22 ` Drew Adams
2011-01-17 18:22 ` Drew Adams
2011-01-15 2:38 ` PJ Weisberg
2011-01-16 21:49 ` Drew Adams
2011-01-10 10:15 ` Dimitri Fontaine
2011-01-05 15:31 ` Christopher Allan Webber
-- strict thread matches above, loose matches on Subject: below --
2011-01-14 1:20 grischka
2011-01-17 12:06 grischka
2011-01-17 12:23 ` Lennart Borgman
2011-01-17 14:37 ` Óscar Fuentes
2011-01-17 16:56 ` Lennart Borgman
2011-01-18 3:03 ` Stephen J. Turnbull
2011-01-18 9:11 ` Lennart Borgman
2011-01-18 12:10 ` grischka
2011-01-17 20:31 Drew Adams
2011-01-17 20:53 ` Lennart Borgman
2011-01-17 21:56 ` Drew Adams
2011-01-17 22:23 ` Lennart Borgman
2011-01-17 23:17 ` Drew Adams
2011-01-17 23:58 ` Lennart Borgman
2011-01-18 0:36 ` Drew Adams
2011-01-18 0:47 ` Lennart Borgman
2011-01-18 1:20 ` Drew Adams
2011-01-18 1:38 ` Lennart Borgman
2011-01-18 3:14 ` Drew Adams
2011-01-18 4:06 ` Stephen J. Turnbull
2011-01-18 9:36 grischka
2011-01-18 12:58 ` Óscar Fuentes
2011-01-18 13:15 ` grischka
2011-01-18 13:27 ` Óscar Fuentes
2011-01-18 17:20 ` Drew Adams
2011-01-19 10:08 ` Stuart Hacking
2011-01-19 19:37 ` Drew Adams
2011-01-20 1:00 ` PJ Weisberg
2011-01-20 17:12 ` Drew Adams
2011-01-20 20:10 ` PJ Weisberg
2011-01-18 13:33 ` Lennart Borgman
2011-01-18 13:51 ` Óscar Fuentes
2011-01-18 17:40 ` Lennart Borgman
2011-01-18 17:52 ` Óscar Fuentes
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=8762trc9mp.fsf@wanadoo.es \
--to=ofv@wanadoo.es \
--cc=emacs-devel@gnu.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).