From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B. T. Raven" Newsgroups: gmane.emacs.help Subject: Re: custom keyboard layout? howto redefine keys? Date: Fri, 10 Apr 2009 04:25:22 -0500 Message-ID: <95ednf9KOIEejULUnZ2dnUVZ_r-dnZ2d@sysmatrix.net> References: <84995d58-0858-4762-b317-8935fdfafcf9@f19g2000yqo.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1239356555 29077 80.91.229.12 (10 Apr 2009 09:42:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Apr 2009 09:42:35 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 10 11:43:54 2009 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 1LsDH7-0005hh-7g for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Apr 2009 11:43:53 +0200 Original-Received: from localhost ([127.0.0.1]:46871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LsDFi-0005RL-Od for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Apr 2009 05:42:26 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!backlog2.nntp.dca.giganews.com!nntp.sysmatrix.net!news.sysmatrix.net.POSTED!not-for-mail Original-NNTP-Posting-Date: Fri, 10 Apr 2009 04:25:22 -0500 User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) Original-Newsgroups: gnu.emacs.help In-Reply-To: <84995d58-0858-4762-b317-8935fdfafcf9@f19g2000yqo.googlegroups.com> Original-Lines: 38 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 12.73.132.45 Original-X-Trace: sv3-Jwd114OwpsqHzlZPDE2tisMiae3q3DwWWnPtRAvZBcG5Nz7H36MxU6+h6MoY3LSdQ05Z3qEvWCnnOO6!s0KS/xl3ywkdPvFkZcVgNYDJsnm1Lxd+tREz98mOggUJNRT0yCIEPN50K0rUdmEgOaJNZwzqQ+z/!qYoYpBOPJABX2n3xWXsmdASvuWNDXg== Original-X-Complaints-To: abuse@sysmatrix.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 X-Original-Bytes: 2531 Original-Xref: news.stanford.edu gnu.emacs.help:168349 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:63627 Archived-At: nic.d.m.1@googlemail.com wrote: > Is there a way to customize the keyboard layout within emacs? For > example if I want "the key on my keyboard labeled 'a' behave like > that labeled 'b' I think the code for my .emacs file should be > something like this: > > (global-set-key ["Key labeled 'a' on my keyboard"] 'ucs-insert 0062) > > I am new to emacs and don't know what the correct syntax for "Key > labeled 'a' on my keyboard' could be. > > So I tried to make f5 instead behave like b: > > (global-set-key [f5] 'ucs-insert 0062) > > Then I get an error message: "Wrong type argument: commandp, (ucs- > insert 62)" if I restart emacs and press f5. > > (For example (global-set-key [f1] 'ucs-insert) works, but then it > asks which UTF-8 character I want to insert, that's not what I want) > > Any ideas? (global-set-key [f5] (lambda () (interactive) (ucs-insert "62"))) ucs-insert seems to want a string; for your original question you could also do this: (global-set-key "a" "b") but you will immediately regret it, since now you won't be able to type the letter a, for example to assign it to another key. At least I couldn't figure out how to undo the damage and I had to re-start Emacs. > > thanks > nic