[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: local key swap? alternatives?
From: |
Stefan Monnier |
Subject: |
Re: local key swap? alternatives? |
Date: |
Fri, 09 Sep 2005 09:18:11 -0400 |
>> Have you taken a look at key-translation-map?
>> Something like
>>
>> (define-key key-translation-map "4" "$")
>> (define-key key-translation-map "$" "4")
> This seems to be better than using the macros but also worse...
> It's better because LaTeX mode still knows that $$, () etc should match
> each other but using key-translation-map, I'm mapping the keys globally,
> so the whole emacs has the keys swapped.
You probably want to do something like:
(set (make-local-variable 'key-translation-map)
(copy-keymap key-translation-map))
before the above two define-keys. And put the whole thing inside
LaTeX-mode-hook (if you're using AUCTeX) or latex-mode-hook (otherwise).
Stefan