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 00:41:49 -0400 Organization: Bell Sympatico Message-ID: <87hdculurz.fsf-monnier+gnu.emacs.help@gnu.org> References: <20050901124642.GB13963@let.rug.nl> <20050907135325.GA13168@let.rug.nl> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1126242077 11855 80.91.229.2 (9 Sep 2005 05:01:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 9 Sep 2005 05:01:17 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 09 07:01:16 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EDazs-0006kN-Qq for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Sep 2005 07:00:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EDazs-0001jS-7B for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Sep 2005 01:00:20 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wns14feed!worldnet.att.net!207.35.177.252!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:Cyd1VPpTUXyqMW/yzVdzTNDrQ6k= Original-Lines: 20 Original-NNTP-Posting-Host: 67.71.33.77 Original-X-Complaints-To: abuse@sympatico.ca Original-X-Trace: news20.bellglobal.com 1126240910 67.71.33.77 (Fri, 09 Sep 2005 00:41:50 EDT) Original-NNTP-Posting-Date: Fri, 09 Sep 2005 00:41:50 EDT Original-Xref: shelby.stanford.edu gnu.emacs.help:133799 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:29346 Archived-At: >> (defmacro define-my-insert (name char) >> "Define the `my-NAME' command, to insert CHAR." >> `(defun ,(intern (format "my-%s" name)) (&optional arg) >> ,(format "Insert \"%c\" at point. >> With a prefix ARG, insert that many characters." >> char) >> (interactive "p") >> (insert-char ,char (or arg 1)))) >> >> (define-my-insert four ?4) >> (define-my-insert dollar ?$) Have you taken a look at key-translation-map? Something like (define-key key-translation-map "4" "$") (define-key key-translation-map "$" "4") -- Stefan