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: remapping keys Date: Wed, 20 Feb 2008 14:53:26 -0500 Organization: UseNetServer.com Message-ID: References: <47b96d58$0$10623$4fafbaef@reader2.news.tin.it> <47b9b97c$0$37201$4fafbaef@reader3.news.tin.it> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1203540108 15539 80.91.229.12 (20 Feb 2008 20:41:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Feb 2008 20:41:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 20 21:42:09 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JRvlQ-0005d3-FS for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Feb 2008 21:42:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JRvkv-0000SC-FB for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Feb 2008 15:41:29 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!208.49.83.146!uns-out.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!TEKSAVVY.COM-Free-a2kHrUvQQWlmc!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:M7GokZ561KwmA4W5RZHedTaGBlw= Original-X-Complaints-To: abuse@usenetserver.com Original-Lines: 40 Original-X-Trace: 9a8a147bc82b56b5d383904966 Original-Xref: shelby.stanford.edu gnu.emacs.help:156345 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:51706 Archived-At: >>> Hi. I'm an Emacs newbie and I need help about remapping keyboard keys. >>> I would like to bind the curly brackets "}" and "{" to another keys, handier >>> to me (I have an italian keyboard, so the key sequence for the brackets is >>> quite clumsy...) >>> What's the procedure for doing so ? >> It all depends on how you want the remapping to behave. Do you want >> this remapping only within Emacs? > Yes. >> Do you want it to apply to things >> like C-{ and M-}? How about C-x { ? > Yes, why not ? Because that's more difficult (unless you answered "no" to the previous question, in which case it's easier instead). You could try (define-key key-translation-map "{" "f") (define-key key-translation-map "}" "g") and if you want to use "f" and "g" for { and }, then add (define-key key-translation-map "f" "{") (define-key key-translation-map "g" "}") Note that it will apply to C-x { but not to C-{ and M-{, C-f, C-g, tho it will apply to ESC { and ESC g. I.e. it's kind of messy. >> I personally prefer to do those kinds of "inconvenient keyboard" things >> globally by choosing another keyboard layout (e.g. with >> gnome-keyboard-properties). > I would prefer a more selective approach, remapping only the keys I need. Define your own keyboard layout? Stefan