all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Guath <stefan@automata.se>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: 12868@debbugs.gnu.org
Subject: bug#12868: global keymap preceeds input-decode-map
Date: Mon, 12 Nov 2012 18:31:48 +0100	[thread overview]
Message-ID: <ED0668BE-8CE0-4C46-9896-2558122D15E5@automata.se> (raw)
In-Reply-To: <jwv1ufy7ogb.fsf-monnier+emacs@gnu.org>

On 12 nov 2012, at 18:03, Stefan Monnier wrote:

>> I understand, and agree that a timeout is a bad idea.  This should be
>> reflected in the manual though, just as it is for local-function-key-map
>> ("Entries in local-function-key-map are ignored if they conflict with
>> bindings made in the minor mode, local, or global keymaps").
> 
> I find it difficult to describe in a precise way without being
> too detailed, but I'll see what I can come up with.

The input-decode-map section could just have the exact same sentence as local-function-key-map has, i.e. "Entries in input-decode-map are ignored if they conflict with bindings made in the minor mode, local, or global keymaps". Since local-function-key-map has that sentence, and input-decode-map does not, one assume that they work differently. Which is not the case.

The key-translation-map section is plain out wrong: "Just like input-decode-map, but unlike local-function-key-map, this keymap is applied regardless of whether the input key-sequence has a normal binding." No, input-decode-map nor key-translation-map has precedence over normal bindings - it's just the other way around.

>> Maybe it should also point out the consequences of binding escape
>> sequences used as prefix for common function keys, i.e. `ESC [' and
>> `ESC O'.  One could even consider to unable colliding bindings to
>> emphasize that you have to choose, rather than 'bugging out' silently.
> 
> Can you expand on what you mean by "unable colliding bindings".  Do you
> mean that in your test case, Emacs should signal an error or at issue
> a warning, after seeing the M-O?
> 
> Note that such colliding bindings already exist in the default config:
> "emacs -nw -Q" and then ESC ESC ESC will run keyboard-escape-quit even
> though the last ESC is a prefix of many function key escape sequences.

Yes, that was sort of what I meant, but I agree it was a bad idea. But the manual could at least conclude the entire section 22.14 with a reminder that since normal bindings do have precedence over all three of input-decode-map, local-function-key-map and key-translation-map, it's a bad idea to bind anything that collides with them such as `ESC O' or `ESC ['. People don't have to understand why - just prevent them from binding M-O and M-[.

>> BTW, the manual states that "The intent of key-translation-map is for users
>> to map one character set to another, including ordinary characters normally
>> bound to self-insert-command."
>> Does this mean that key-translation-map is the recommended way to
>> implement different layouts such as Colemak/Dvorak etc at the lowest
>> possible level?
> 
> No, I don't think so.  But to tell you the truth, I do not know
> understand the reasoning behind key-translation-map.

Me neither... It's confusing...

> Also, I don't think there is a "recommended way" to provide such
> a remapping within Emacs, currently.  Or rather than recommended way is
> probably to do the remapping outside of Emacs.

Thanks! I've struggled with this and always thought that I missed something obvious.

>> If yes, in the case of remapping `o' to `y' (Colemak example), M-O would
>> never get through the input-decode-map filter and therefore never pop up to
>> key-translation-map in order to produce M-Y. Is that correct?
> 
> Yes, that's right.

Great - I thought I'd misunderstood something fundamental. Thanks for all the clarifications!






  reply	other threads:[~2012-11-12 17:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-12  9:06 bug#12868: global keymap preceeds input-decode-map Stefan Guath
2012-11-12 14:32 ` Stefan Monnier
2012-11-12 15:27   ` Stefan Guath
2012-11-12 17:03     ` Stefan Monnier
2012-11-12 17:31       ` Stefan Guath [this message]
2012-11-12 21:07         ` Stefan Monnier
2012-11-15 14:17           ` Stefan Monnier

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=ED0668BE-8CE0-4C46-9896-2558122D15E5@automata.se \
    --to=stefan@automata.se \
    --cc=12868@debbugs.gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /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.