From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: elisp question:keyboard-translate with hyper fail? Date: Sat, 12 Mar 2011 16:16:15 -0500 Message-ID: References: <86aa8db7-62db-478d-940d-82609c8dde34@18g2000prd.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1299964613 24214 80.91.229.12 (12 Mar 2011 21:16:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 12 Mar 2011 21:16:53 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Le Wang Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Mar 12 22:16:49 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PyWB7-0002Ly-6E for geh-help-gnu-emacs@m.gmane.org; Sat, 12 Mar 2011 22:16:49 +0100 Original-Received: from localhost ([127.0.0.1]:37829 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PyWB6-0005cE-Ad for geh-help-gnu-emacs@m.gmane.org; Sat, 12 Mar 2011 16:16:48 -0500 Original-Received: from [140.186.70.92] (port=37328 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PyWAc-0005c4-6f for help-gnu-emacs@gnu.org; Sat, 12 Mar 2011 16:16:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PyWAa-0000r5-Q8 for help-gnu-emacs@gnu.org; Sat, 12 Mar 2011 16:16:18 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:11409 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PyWAa-0000qo-Kb for help-gnu-emacs@gnu.org; Sat, 12 Mar 2011 16:16:16 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEANdxe03O+IG+/2dsb2JhbACmQnjANYViBIUrkCE X-IronPort-AV: E=Sophos;i="4.62,308,1297054800"; d="scan'208";a="96054355" Original-Received: from 206-248-129-190.dsl.teksavvy.com (HELO pastel.home) ([206.248.129.190]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 12 Mar 2011 16:16:15 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 4A37458FE0; Sat, 12 Mar 2011 16:16:15 -0500 (EST) In-Reply-To: (Le Wang's message of "Sat, 12 Mar 2011 12:51:56 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:80039 Archived-At: > I got these exact keyboard-translate lines from Xah's blog. They don't work > reliably on Windows. Sometimes after switching back to Emacs from another > program, and my first input to Emacs is C-j, C-j still registers instead of > C-x. Sounds like a bug (even sounds like one that's already been reported but that we're having trouble tracking down). But I can't find it in the bug database, so maybe it's something different. So please M-x report-emacs-bug an include as much info as possible to help us reproduce the bug. > How would I use key-translation-map to do the swap? > (define-key key-translation-map [(control x)] [(control j)]) > (define-key key-translation-map [(control j)] [(control x)]) Yes. > C-j seems regixter as C-x. But C-x acting like a prefix key, waiting for > the next input. I think that's because of function-key-map's remapping of C-x @ S to S-. If you add (define-key function-key-map [?\C-x] nil), it might work (it does for me). Stefan