From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: 'ignore hides \r in keymap Date: Thu, 03 Nov 2005 23:10:07 +0100 Message-ID: <436A8ABF.7080101@student.lu.se> References: <436802B8.4090509@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: Quoted-Printable X-Trace: sea.gmane.org 1131055904 339 80.91.229.2 (3 Nov 2005 22:11:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 3 Nov 2005 22:11:44 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 03 23:11:41 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EXnHy-0003Qt-GY for ged-emacs-devel@m.gmane.org; Thu, 03 Nov 2005 23:10:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EXnHw-0001uQ-IF for ged-emacs-devel@m.gmane.org; Thu, 03 Nov 2005 17:10:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EXnHh-0001uG-MC for emacs-devel@gnu.org; Thu, 03 Nov 2005 17:10:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EXnHf-0001tw-Iu for emacs-devel@gnu.org; Thu, 03 Nov 2005 17:10:13 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EXnHf-0001tt-Dg for emacs-devel@gnu.org; Thu, 03 Nov 2005 17:10:11 -0500 Original-Received: from [81.228.8.164] (helo=pne-smtpout2-sn2.hy.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EXnHe-0000Vw-5k for emacs-devel@gnu.org; Thu, 03 Nov 2005 17:10:11 -0500 Original-Received: from [192.168.123.121] (83.249.218.244) by pne-smtpout2-sn2.hy.skanova.net (7.2.060.1) id 4365DD8D00131699; Thu, 3 Nov 2005 23:10:07 +0100 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: =?UTF-8?B?Sm9oYW4gQm9ja2fDpXJk?= In-Reply-To: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:45376 Archived-At: Johan Bockg=C3=A5rd wrote: >Lennart Borgman writes: > > =20 > >>This is one of those strange errors I wish I did not see. It seems like= =20 >>'ignore somehow hides \r in a keymap. To show this start with "emacs -Q= "=20 >>and evaluate the following: >> >> ;; Set up >> (defconst km (make-sparse-keymap)) >> (define-key km "\r" (lambda()(interactive)(message "hit RET"))) >> >> ;; Convinience switching to/from km >> (define-key km [(home)] (lambda()(interactive)(use-local-map nil))) >> (global-set-key [(control meta home)]=20 >>(lambda()(interactive)(use-local-map km))) >> >> ;; Test using either of these and then hit RET >> (define-key km [?i] (lambda()(interactive)(define-key km '[t] 'ignore)= )) >> (define-key km [?n] (lambda()(interactive)(define-key km '[t] nil))) >> >>Activate the km keymap with C-M-home. Switch between using 'ignore or=20 >>nil for unbound keys in km by hitting i and n. I see the following: >> >>- Using nil and hitting RET gives the message "hit RET" >>- Using 'ignore and hitting RET gives nothing. >> >>I am doing this with CVS Emacs from 2005-10-27 on w32. >> =20 >> > >Looks like it's a problem of RET (C-m) vs (function key). You >would see the same thing if you bound TAB (C-i) and pressed etc. > >Apparently the default binding is used before the --> RET >translation is made. > >In other words, after you press "i": > >(key-binding [return] t) =3D> ignore >(key-binding "\C-m" t) =3D> (lambda nil (interactive) (message "hit RE= T")) > > =20 > Yes, thanks, I vaugely thought so. Maybe I should not ask for a=20 workaround. We have had much consensus that this is just creating=20 problems during a development phase. But I do not at all understand how=20 to fix this. I think you need to have a personal history in Emacs to fix=20 this the right way.