From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Holger Ki Newsgroups: gmane.emacs.help Subject: key-translation-map and prefixes Date: Fri, 5 Aug 2016 16:33:54 +0200 Message-ID: <20160805143354.GA27047@dings64> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: blaine.gmane.org 1470408415 30540 195.159.176.226 (5 Aug 2016 14:46:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 5 Aug 2016 14:46:55 +0000 (UTC) User-Agent: Mutt/1.5.22 (2013-10-16) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 05 16:46:48 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVgOZ-0006QO-Eu for geh-help-gnu-emacs@m.gmane.org; Fri, 05 Aug 2016 16:46:43 +0200 Original-Received: from localhost ([::1]:45709 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVgOW-0006t1-2w for geh-help-gnu-emacs@m.gmane.org; Fri, 05 Aug 2016 10:46:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVgE2-0001bL-An for help-gnu-emacs@gnu.org; Fri, 05 Aug 2016 10:35:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVgDz-0006FC-3m for help-gnu-emacs@gnu.org; Fri, 05 Aug 2016 10:35:50 -0400 Original-Received: from mout2.freenet.de ([2001:748:100:40::2:4]:54140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVgDy-0006EN-QS for help-gnu-emacs@gnu.org; Fri, 05 Aug 2016 10:35:47 -0400 Original-Received: from [195.4.92.140] (helo=mjail0.freenet.de) by mout2.freenet.de with esmtpa (ID holger.ki@freenet.de) (port 25) (Exim 4.85 #1) id 1bVgDs-0002kc-RU for help-gnu-emacs@gnu.org; Fri, 05 Aug 2016 16:35:40 +0200 Original-Received: from localhost ([::1]:37966 helo=mjail0.freenet.de) by mjail0.freenet.de with esmtpa (ID holger.ki@freenet.de) (Exim 4.85 #1) id 1bVgDs-0007KR-Nb for help-gnu-emacs@gnu.org; Fri, 05 Aug 2016 16:35:40 +0200 Original-Received: from mx17.freenet.de ([195.4.92.27]:40342) by mjail0.freenet.de with esmtpa (ID holger.ki@freenet.de) (Exim 4.85 #1) id 1bVgBK-0004xr-Bn for help-gnu-emacs@gnu.org; Fri, 05 Aug 2016 16:33:02 +0200 Original-Received: from x5d855bf0.dyn.telefonica.de ([93.133.91.240]:38951 helo=dings64) by mx17.freenet.de with esmtpsa (ID holger.ki@freenet.de) (TLSv1:DHE-RSA-AES256-SHA:256) (port 587) (Exim 4.85 #1) id 1bVgBK-0006yO-6Y for help-gnu-emacs@gnu.org; Fri, 05 Aug 2016 16:33:02 +0200 Content-Disposition: inline X-Originated-At: 93.133.91.240!38951 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:748:100:40::2:4 X-Mailman-Approved-At: Fri, 05 Aug 2016 10:46:12 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111069 Archived-At: Dear ML, I'm running GNU Emacs 24.5.1 in an ordinary Linux TTY using a PC-style keyboard. Before that I was using an editor striking similar to emacs + evil-mode. :-) In order to switch from insert state back to normal state in evil-mode, one uses the escape key (like in vim). A nice shortcut that worked in vim was to use the Alt-key together with the next normal-state command to switch to normal state and do the command without having to stretch to the escape key. Now my question: Is it possible to use a keyboard translation map to map e.g. M-0, M-k, M-x, etc, to the sequence escape key followed by 0, k or x? Among other things I tried this in my .emacs: (define-key key-translation-map (kbd "\M-0") (kbd "\E 0")) But this doesn't work, as the escape key still gets recognised as ESC-prefix after the translation. Is there a way to prevent emacs from interpreting the Escape key as prefix again? Holger