From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#12868: global keymap preceeds input-decode-map Date: Mon, 12 Nov 2012 09:32:29 -0500 Message-ID: References: <48A818DA-1AA9-4657-AC38-BE822EA18C65@automata.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1352730828 6724 80.91.229.3 (12 Nov 2012 14:33:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Nov 2012 14:33:48 +0000 (UTC) Cc: 12868@debbugs.gnu.org To: Stefan Guath Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 12 15:33:58 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TXv5J-00075V-UF for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Nov 2012 15:33:58 +0100 Original-Received: from localhost ([::1]:41727 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXv59-00027c-Nw for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Nov 2012 09:33:47 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:38376) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXv54-00026n-K3 for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2012 09:33:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXv51-0006hB-IB for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2012 09:33:42 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53129) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXv51-0006h5-FP for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2012 09:33:39 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TXv5P-0002d8-5X for bug-gnu-emacs@gnu.org; Mon, 12 Nov 2012 09:34:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Nov 2012 14:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12868 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12868-submit@debbugs.gnu.org id=B12868.135273078310036 (code B ref 12868); Mon, 12 Nov 2012 14:34:02 +0000 Original-Received: (at 12868) by debbugs.gnu.org; 12 Nov 2012 14:33:03 +0000 Original-Received: from localhost ([127.0.0.1]:35146 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TXv4P-0002bh-Nk for submit@debbugs.gnu.org; Mon, 12 Nov 2012 09:33:03 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:20147) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TXv4J-0002bU-9f for 12868@debbugs.gnu.org; Mon, 12 Nov 2012 09:32:55 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAG6Zu09sr+ZY/2dsb2JhbABEtBGBCIIVAQEEAVYjBQsLNBIUGA0kiBwFugmQRAOIQppxgViDBw X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="206970408" Original-Received: from 108-175-230-88.dsl.teksavvy.com (HELO pastel.home) ([108.175.230.88]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 12 Nov 2012 09:32:30 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 8278A5978D; Mon, 12 Nov 2012 09:32:29 -0500 (EST) In-Reply-To: <48A818DA-1AA9-4657-AC38-BE822EA18C65@automata.se> (Stefan Guath's message of "Mon, 12 Nov 2012 10:06:38 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-Spam-Score: 0.8 (/) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:66791 Archived-At: > 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 , 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