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

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

key-translation-map and combinations


From: Vesa Paatero
Subject: key-translation-map and combinations
Date: Sun, 25 May 2014 01:13:30 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Hi,

What I'm trying to do is map the usual C-s search to C-f and the usual C-xC-s saving to C-s.
Now, you can do this:

(define-key key-translation-map "\C-f" "\C-s")
(define-key key-translation-map "\C-s" "\C-x\C-s")

but then you'll notice that longer sequences like C-xC-f will also be affected and change to e.g. C-xC-s. This can be avoided by defining the longer sequences back to themselves like this:

(define-key key-translation-map "\C-x\C-f" "\C-x\C-f")
(define-key key-translation-map "\C-x\C-s" "\C-x\C-s")

but that is no perfect solution since there is no known number of those longer sequences as new modes can establish them.

My question: Has anyone found a way to make translation mappings like these so that a key is only translated when it begins a key sequence?

Thanks for any help,
Vesa



reply via email to

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