From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: local key swap? alternatives? Date: Fri, 09 Sep 2005 09:18:11 -0400 Organization: Bell Sympatico Message-ID: <87ll26idpc.fsf-monnier+gnu.emacs.help@gnu.org> References: <20050901124642.GB13963@let.rug.nl> <20050907135325.GA13168@let.rug.nl> <87hdculurz.fsf-monnier+gnu.emacs.help@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1126274092 10524 80.91.229.2 (9 Sep 2005 13:54:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 9 Sep 2005 13:54:52 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 09 15:54:51 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EDjJD-0008U3-EM for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Sep 2005 15:52:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EDjJC-0003VO-U0 for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Sep 2005 09:52:50 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!newsflash.concordia.ca!News.Dal.Ca!ursa-nb00s0.nbnet.nb.ca!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Cancel-Lock: sha1:HcMCmW2vIWpDegLMZ/L4byKcCU0= Original-Lines: 22 Original-NNTP-Posting-Host: 67.71.33.77 Original-X-Complaints-To: abuse@sympatico.ca Original-X-Trace: news20.bellglobal.com 1126271893 67.71.33.77 (Fri, 09 Sep 2005 09:18:13 EDT) Original-NNTP-Posting-Date: Fri, 09 Sep 2005 09:18:13 EDT Original-Xref: shelby.stanford.edu gnu.emacs.help:133809 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:29356 Archived-At: >> 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