all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lennart Borgman <lennart.borgman.073@student.lu.se>
Cc: emacs-devel@gnu.org
Subject: Re: 'ignore hides \r in keymap
Date: Thu, 03 Nov 2005 23:10:07 +0100	[thread overview]
Message-ID: <436A8ABF.7080101@student.lu.se> (raw)
In-Reply-To: <yoijr79xjt8g.fsf@linus003.dd.chalmers.se>

Johan Bockgård wrote:

>Lennart Borgman <lennart.borgman.073@student.lu.se> writes:
>
>  
>
>>This is one of those strange errors I wish I did not see. It seems like 
>>'ignore somehow hides \r in a keymap. To show this start with "emacs -Q" 
>>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)] 
>>(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 
>>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.
>>    
>>
>
>Looks like it's a problem of RET (C-m) vs <return> (function key). You
>would see the same thing if you bound TAB (C-i) and pressed <tab> etc.
>
>Apparently the default binding is used before the <return> --> RET
>translation is made.
>
>In other words, after you press "i":
>
>(key-binding [return] t) => ignore
>(key-binding "\C-m" t)   => (lambda nil (interactive) (message "hit RET"))
>
>  
>
Yes, thanks, I vaugely thought so. Maybe I should not ask for a 
workaround. We have had much consensus that this is just creating 
problems during a development phase. But I do not at all understand how 
to fix this. I think you need to have a personal history in Emacs to fix 
this the right way.

  reply	other threads:[~2005-11-03 22:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-02  0:05 'ignore hides \r in keymap Lennart Borgman
2005-11-03 17:26 ` Lennart Borgman
2005-11-03 21:50 ` Johan Bockgård
2005-11-03 22:10   ` Lennart Borgman [this message]
2005-11-04  4:26   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=436A8ABF.7080101@student.lu.se \
    --to=lennart.borgman.073@student.lu.se \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.