From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Newsgroups: gmane.emacs.help Subject: Re: remapping keys Date: Wed, 20 Feb 2008 03:12:34 +0100 Message-ID: <200802200312.34753.juanma_bellon@yahoo.es> References: <47b96d58$0$10623$4fafbaef@reader2.news.tin.it> <87skzompr3.fsf@nospam.please.ucdavis.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1203473796 19361 80.91.229.12 (20 Feb 2008 02:16:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Feb 2008 02:16:36 +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 03:16:59 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 1JReVr-0007qs-G3 for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Feb 2008 03:16:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JReVM-0002Zm-HP for geh-help-gnu-emacs@m.gmane.org; Tue, 19 Feb 2008 21:16:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JReV5-0002XM-1v for help-gnu-emacs@gnu.org; Tue, 19 Feb 2008 21:15:59 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JReV3-0002Vm-Ie for help-gnu-emacs@gnu.org; Tue, 19 Feb 2008 21:15:58 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JReV3-0002Vf-EO for help-gnu-emacs@gnu.org; Tue, 19 Feb 2008 21:15:57 -0500 Original-Received: from n16.bullet.mail.mud.yahoo.com ([68.142.201.239]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1JReV3-0007wI-69 for help-gnu-emacs@gnu.org; Tue, 19 Feb 2008 21:15:57 -0500 Original-Received: from [209.191.108.97] by n16.bullet.mail.mud.yahoo.com with NNFMP; 20 Feb 2008 02:15:56 -0000 Original-Received: from [68.142.201.66] by t4.bullet.mud.yahoo.com with NNFMP; 20 Feb 2008 02:15:56 -0000 Original-Received: from [127.0.0.1] by omp418.mail.mud.yahoo.com with NNFMP; 20 Feb 2008 02:15:56 -0000 X-Yahoo-Newman-Id: 72211.10690.bm@omp418.mail.mud.yahoo.com Original-Received: (qmail 11149 invoked from network); 20 Feb 2008 02:15:55 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.es; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Subject:Date:User-Agent:References:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-Disposition:Message-Id; b=Uh7WnE8K8dL+xLoClUW+7Z0zSKEh8MjdPRjHUaTd/ETs4Brgr6PaMx98uJtnBxAcfOf7vnzyLVYu3KUyPoWdyWGVwGlDrJZMaqtp4IlGvymmzTqyRFOLDmbk9BSu3hyYRlRjv5oEFQXdzgFwaR6ZeGl4K8DarFgTEsiLPd1AsLI= ; Original-Received: from unknown (HELO unknown-00-1a-4b-5b-1d-b3.lan) (devil_juanek@84.48.124.232 with plain) by smtp102.plus.mail.mud.yahoo.com with SMTP; 20 Feb 2008 02:15:55 -0000 X-YMail-OSG: 2hIx4UYVM1mhqo2vTVYnoRI3NknaQeCRGqs8m1IV3Zq4MIIkoNxGPsWSurd40RUtxVljmSzYDA-- X-Yahoo-Newman-Property: ymail-3 User-Agent: KMail/1.9.5 In-Reply-To: <87skzompr3.fsf@nospam.please.ucdavis.edu> Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) 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:51691 Archived-At: On Wednesday 20 February 2008 01:32, Sam Peterson wrote: > Wow, a whole thread on remapping keys, and NOBODY mentions > global-set-key or local-set-key. > > ;; just an example, change the keys to whatever you like > (global-set-key "{" '(lambda () (interactive) (insert "a"))) > > Many will argue that keyboard translate is better. Whatever works... I thought of it but I rejected it because the point is not just to get a cu= rly=20 bracket inserted in the text, but also to use it in keystrokes, which I gue= ss=20 can't be done with that lambda form. I can't figure any other way to do it= =20 than keyboard-translate. Involving only Emacs in the solution, that is. Sadly, no approach solves the problem. Neither the above lambda form, nor=20 keyboard-translate=B9, nor define-key=B2 provide a substitution of keys=20 throughout the whole Emacs cathedral: in keystrokes the original key still= =20 applies. =B9: (keyboard-translate ?. ?/) =B2: (define-key global-map (kbd ".") (kbd "/")) In any of these cases, asking for the command mapped to M-. will give exact= ly=20 that, not the command mapped to M-/ as intended. It is still possible to re-map *all* keystrokes using curly brackets to mak= e=20 them use something more comfortable, but ... well, no way. Juanma