|
From: | Vesa Paatero |
Subject: | Re: key-translation-map and combinations |
Date: | Thu, 29 May 2014 16:10:41 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
2014-05-25 22:33, Stefan Monnier wrote:
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?Yes: don't use key-translation-map. Instead, change global-map. (define-key global-map [?\C-f] (lookup-key global-map [?\C-s])) (define-key global-map [?\C-s] (lookup-key global-map [?\C-x ?\C-s]))
Thanks for that hint. Alas, I found a subtle difference there. Try the following: Use
(define-key global-map [?\C-f] (lookup-key global-map [?\C-s]))to set C-f and then open some local directory (Emacs showing "Dired by name"). There, type Control-f and some search key that can be found repeatedly in your directory. Then press Control-f repeatedly. My observation is that repeated search by Control-f doesn't work like it does when you use Control-s directly. However, if you use remap C-f using
(define-key key-translation-map "\C-f" "\C-s")then repeated searching works with Control-f. This observation was made on Emacs 23.3.1. Can you repeat this in your version of Emacs? Any ideas for explanation?
Vesa
[Prev in Thread] | Current Thread | [Next in Thread] |