all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Stephen J. Turnbull'" <stephen@xemacs.org>
Cc: 'Emacs-Devel devel' <emacs-devel@gnu.org>
Subject: RE: Bikeshedding "user choice"
Date: Wed, 19 Jan 2011 11:34:18 -0800	[thread overview]
Message-ID: <CC7464DC3325441081D30E1CB1C67F2C@us.oracle.com> (raw)
In-Reply-To: <87ipxl7alc.fsf@uwakimon.sk.tsukuba.ac.jp>

>  > Calm down, please; no need to shout.
> 
> That was not "shouting", that was the 2x4 which seems to be essential
> for getting the mule's attention.

And no need for name-calling.

> nobody proposes to change Emacs's behavior with respect to
> unbound keys.  Lennart ... proposes to allow implicit binding
> via the GUI environment, as well as explicit binding within
> Emacs. Ie, his proposal is really to change the definition of
> "bound".

A radical change to the definition of "bound" for Emacs is a proposal to change
Emacs's behavior wrt unbound keys.

> Lennart wants "delegate to OS" to be the fallback for *all* keys,
> *not* restricted to M-F4....   currently the default is "if Emacs
> doesn't explicitly bind a key, by default stroking it leads to
> an error", and Lennart proposes to change that default to "if
> Emacs doesn't explicitly bind a key, look a little harder to see
> if the environment binds it."
>
> What Lennart wants, as far as I can tell, is
> (1) Emacs can explicitly (un)bind a key (the "unbound" state is
>     achieved with `(define-key map key nil)').  In case of an
>     explicitly unbound keystroke, Emacs will signal an unbound error.
> (2) If (1) does not hold, then Emacs will *implicitly* bind the key to
>     an action determined by the GUI if the GUI defines one.
> (3) If neither (1) nor (2) holds, Emacs signals an unbound error when
>     the key is stroked.
> 
> This is a change in the definition of "binding".

I understood Lennart the same way (except that as he pointed out it is an
unbound message, not an unbound error).

I disagree that this is the right approach.  I prefer that the set of keys for
which pass-through is currently effective be explicit within Emacs, for users
and Lisp.

If each key for which we want pass-through has an Emacs binding that specifies
this (pass-through), then it is clear to everyone what that key does in Emacs
(it is handled by the OS).  Likewise, for Stefan's alternative of using
`w32-passthrough-events'.

Otherwise (in Lennart's proposal as you have described it):

1. To turn off this behavior globally, you must bind each Windows hotkey to nil
explicitly (unless it is already bound to an Emacs command).

How do you find all such hotkeys?  Examine the Windows doc...  But wait?!
Applications and hardware OEMs can assign Windows hot keys too.  How do you find
them all?  Search the registry?

2. Since "bound" would have a new meaning in Emacs, what would key lookup
mean/do?  Until now, being unbound has been effectively the same as having a nil
binding.  And your (1) above maintains that terminology - OK.

So now how does your code distinguish "unbound" as a nil binding from "neither
bound or unbound" (no explicit binding, either command or nil)?  If M-f4 is not
bound to nil or to a command then is it unbound?  bound?  Well, your (2) says
that Emacs will have *implicitly* bound it to a GUI action (if available).

Sometimes people mean "automatically" when they say "implicitly", so let's
check: Does "implicit" here mean just automatic, so that once this binding has
been created automatically it is seen in Emacs Lisp as a (normal) binding?  Or
is there never any Emacs binding, just a virtual, extra-Emacs binding?

In the latter case (which I'm guessing you mean), how can Lisp code determine
whether a given key has an effect (let alone what that effect might be)?

Will `lookup-key' change, or will it still return nil for a key that has not
been given any explicit binding (nil or otherwise)?  In the latter case it does
not distinguish a key that will be handled by Windows from a key which has been
explicitly bound to nil.

It is far better IMO to make such connections between keys and actions explicit,
for Emacs users and at the Lisp level.  Use an explicit Emacs binding:
(define-key KEY 'w32-syskey).  Or use an explicit mapping variable such as
`w32-passthrough-events'.  Users and Lisp code can then see what's happening,
and it is trivial to turn it off, all of it.

And if tomorrow some new app or new hardware changes Windows to add its own
global hotkey, then nothing changes in Emacs (POLA), since the key was not added
at the Emacs level (binding to `w32-syskey', or `w32-passthrough-events entry).
What Emacs users and code see, in Emacs, is what they get.




  reply	other threads:[~2011-01-19 19:34 UTC|newest]

Thread overview: 90+ 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
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 [this message]
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-19 21:51 Bikeshedding "user choice" grischka
2011-01-19 23:27 ` Drew Adams
2011-01-20 18:18   ` grischka

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CC7464DC3325441081D30E1CB1C67F2C@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=stephen@xemacs.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.