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#9417: digit-argument doesn't work with `key-translation-map' Date: Thu, 01 Sep 2011 22:37:44 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1314931133 26726 80.91.229.12 (2 Sep 2011 02:38:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 2 Sep 2011 02:38:53 +0000 (UTC) Cc: 9417@debbugs.gnu.org To: Le Wang Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 02 04:38:49 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QzJeb-0002ns-7a for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Sep 2011 04:38:49 +0200 Original-Received: from localhost ([::1]:56728 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzJea-0005B4-Pq for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Sep 2011 22:38:48 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:40933) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzJeY-0005An-1J for bug-gnu-emacs@gnu.org; Thu, 01 Sep 2011 22:38:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QzJeX-0005Ad-11 for bug-gnu-emacs@gnu.org; Thu, 01 Sep 2011 22:38:46 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzJeW-0005AZ-Vk for bug-gnu-emacs@gnu.org; Thu, 01 Sep 2011 22:38:44 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QzJhm-0000q6-E8; Thu, 01 Sep 2011 22:42:06 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Sep 2011 02:42:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9417 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9417-submit@debbugs.gnu.org id=B9417.13149312733145 (code B ref 9417); Fri, 02 Sep 2011 02:42:05 +0000 Original-Received: (at 9417) by debbugs.gnu.org; 2 Sep 2011 02:41:13 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QzJgv-0000og-CE for submit@debbugs.gnu.org; Thu, 01 Sep 2011 22:41:13 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QzJgq-0000oV-40 for 9417@debbugs.gnu.org; Thu, 01 Sep 2011 22:41:09 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EADtAYE64rwMJ/2dsb2JhbABCqFJ4gUABAQQBViMFCwsOJhIUDQsNEAETE4dyuguGXwSdIoJthEA X-IronPort-AV: E=Sophos;i="4.68,317,1312171200"; d="scan'208";a="134005044" Original-Received: from 184-175-3-9.dsl.teksavvy.com (HELO ceviche.home) ([184.175.3.9]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 01 Sep 2011 22:37:45 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id A77FD660B6; Thu, 1 Sep 2011 22:37:44 -0400 (EDT) In-Reply-To: (Le Wang's message of "Thu, 1 Sep 2011 18:26:34 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 01 Sep 2011 22:42:06 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) 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:50538 Archived-At: >>>>> "Le" == Le Wang writes: > repro: > 1. emacs -Q > 2. eval-region: > (define-key key-translation-map [(control x)] [(control j)]) > (define-key key-translation-map [(control j)] [(control x)]) > 3. C-1 C-j C-f > expectation: call `find-file' > actual: call binding of C-j `eval-print-last-sexp' > Emacs version: CVS Head built today on Windows 7. I hope you meant "Bazaar head" since we stopped using CVS a few years ago. I think the problem is that universal-argument-other-key reads the key just pressed with this-command-keys (which is the key after translation) and then puts it into unread-command-events which will cause this key to be re-translated. My experience is that reading an event and putting it back into unread-command-events is something fiendishly difficult to do right, which prompted me to develop set-temporary-overlay-map, but this is not ready for 24.1 (and it may never be ready, since it may come with its own set of problems). > In Emacs 23, the behavior is slightly different. C-1 C-j calls > `eval-print-last-sexp' withing the final C-f key chord. And in both Emacs23 and current Bzr head, C-u 1 C-j gives me Args out of range: " C-x", 0, 5 tho it seems to depend on what I've done before. This seems to be a separate bug. Stefan