help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

key-translation-map and prefixes


From: Holger Ki
Subject: key-translation-map and prefixes
Date: Fri, 5 Aug 2016 16:33:54 +0200
User-agent: Mutt/1.5.22 (2013-10-16)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]