all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* A possible bug in the use of "\C-m"/[return] in define-key
@ 2008-04-29 21:38 Lennart Borgman (gmail)
  2008-04-30  3:30 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Lennart Borgman (gmail) @ 2008-04-29 21:38 UTC (permalink / raw)
  To: Emacs Devel, Michael Kifer

I just noticed that

   (define-key js2-mode-map [return] #'js2-enter-key)
   (use-local-map js2-mode-map)

overrides

   (define-key viper-vi-basic-map "\C-m" 'viper-next-line-at-bol)

even though viper-vi-basic-map is managed in `emulation-mode-map-alists'.

I mean that when I type RET I get js2-enter-key, not viper-next-line-at-bol.

Something is obviously wrong - somewhere, but where?




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: A possible bug in the use of "\C-m"/[return] in define-key
  2008-04-29 21:38 A possible bug in the use of "\C-m"/[return] in define-key Lennart Borgman (gmail)
@ 2008-04-30  3:30 ` Stefan Monnier
  2008-04-30  7:06   ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2008-04-30  3:30 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: Michael Kifer, Emacs Devel

> I just noticed that

>   (define-key js2-mode-map [return] #'js2-enter-key)
>   (use-local-map js2-mode-map)

> overrides

>   (define-key viper-vi-basic-map "\C-m" 'viper-next-line-at-bol)

> even though viper-vi-basic-map is managed in `emulation-mode-map-alists'.

> I mean that when I type RET I get js2-enter-key, not viper-next-line-at-bol.

> Something is obviously wrong - somewhere, but where?

js2 should probably not bind `return' but "\C-m".
By binding `return' it asks Emacs to distinguish `return' from C-m.
Of course under ttys `return' doesn't exist, only C-m does so js2's
binding won't work there.


        Stefan




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: A possible bug in the use of "\C-m"/[return] in define-key
  2008-04-30  3:30 ` Stefan Monnier
@ 2008-04-30  7:06   ` Lennart Borgman (gmail)
  0 siblings, 0 replies; 3+ messages in thread
From: Lennart Borgman (gmail) @ 2008-04-30  7:06 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Michael Kifer, Emacs Devel

Stefan Monnier wrote:
>> I just noticed that
> 
>>   (define-key js2-mode-map [return] #'js2-enter-key)
>>   (use-local-map js2-mode-map)
> 
>> overrides
> 
>>   (define-key viper-vi-basic-map "\C-m" 'viper-next-line-at-bol)
> 
>> even though viper-vi-basic-map is managed in `emulation-mode-map-alists'.
> 
>> I mean that when I type RET I get js2-enter-key, not viper-next-line-at-bol.
> 
>> Something is obviously wrong - somewhere, but where?
> 
> js2 should probably not bind `return' but "\C-m".
> By binding `return' it asks Emacs to distinguish `return' from C-m.
> Of course under ttys `return' doesn't exist, only C-m does so js2's
> binding won't work there.


Thanks. I just saw that Steve has already changed the binding to C-m.

Maybe such key binding troubles should be described in the manual? Or is 
it already there?




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-04-30  7:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-29 21:38 A possible bug in the use of "\C-m"/[return] in define-key Lennart Borgman (gmail)
2008-04-30  3:30 ` Stefan Monnier
2008-04-30  7:06   ` Lennart Borgman (gmail)

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.