unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Stefan Guath <stefan@automata.se>
Cc: 12868@debbugs.gnu.org
Subject: bug#12868: global keymap preceeds input-decode-map
Date: Mon, 12 Nov 2012 09:32:29 -0500	[thread overview]
Message-ID: <jwvtxsudi5s.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <48A818DA-1AA9-4657-AC38-BE822EA18C65@automata.se> (Stefan Guath's message of "Mon, 12 Nov 2012 10:06:38 +0100")

> emacs -nw -Q
> (defun foo () (interactive) (message "foo"))
> (global-set-key "\M-O" 'foo)
[...]
> Arrow keys now inserts A,B,C,D in buffer.
[...]
> Arrow keys sends M-O A (up), M-O B (down) etc. These should be
> translated to function keys <up>, <down> etc in input-decode-map
> before any key lookup.  Somehow, the binding of M-O in the global
> keymap takes precedence.

Indeed, thanks for bringing this up.  The cause for the bug is that the
rule for what goes first and what goes next is here ignored because we
stop waiting for more input as soon as a real binding is found
(i.e. right after M-O).

The predicate that decides when to stop waiting for more input would
need to say say "don't stop if we're in the middle of a potential
input-decode-map rewrite".  But then if you want to run `foo', you'd
have the problem that after hitting M-O, Emacs will not actually run
`foo' but will sit there waiting to see if the next key is one of
[ABCD].

The only way to get our cake and eat it too would be to use some kind of
timeout, which we have resisted so far.


        Stefan





  reply	other threads:[~2012-11-12 14:32 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 [this message]
2012-11-12 15:27   ` Stefan Guath
2012-11-12 17:03     ` Stefan Monnier
2012-11-12 17:31       ` Stefan Guath
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

  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=jwvtxsudi5s.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=12868@debbugs.gnu.org \
    --cc=stefan@automata.se \
    /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).