* M-RET ok, C-RET wrong?
@ 2024-08-24 4:51 Kepa via Users list for the GNU Emacs text editor
2024-08-24 6:21 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Kepa via Users list for the GNU Emacs text editor @ 2024-08-24 4:51 UTC (permalink / raw)
To: Kepa via Users list for the GNU Emacs text editor
Hello,
I’m experiencing strange behavior when setting a keybinding.
C-RET keybinding does not work for me, and I have had to use C-<return>, although M-RET does work:
This doesn’t work:
(define-key dired-mode-map (kbd "C-RET") 'dired-w32explore)
I receive this message:
C-<return> is undefined
This works, though:
(define-key dired-mode-map (kbd "C-<return>") 'dired-w32explore)
This works too:
(define-key dired-mode-map (kbd "M-RET") 'dired-create-directory)
GNU Emacs 29.3 (build 2, x86_64-w64-mingw32) of 2024-03-24
Best regards
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: M-RET ok, C-RET wrong?
2024-08-24 4:51 Kepa via Users list for the GNU Emacs text editor
@ 2024-08-24 6:21 ` Eli Zaretskii
2024-08-24 7:16 ` Arash Esbati
0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2024-08-24 6:21 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Sat, 24 Aug 2024 04:51:16 +0000
> From: Kepa via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
>
> C-RET keybinding does not work for me, and I have had to use C-<return>, although M-RET does work:
I think that's because RET is actually C-m, and you cannot have two
Ctrl modifiers on the same key.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: M-RET ok, C-RET wrong?
2024-08-24 6:21 ` Eli Zaretskii
@ 2024-08-24 7:16 ` Arash Esbati
2024-08-24 7:33 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Arash Esbati @ 2024-08-24 7:16 UTC (permalink / raw)
To: help-gnu-emacs
Eli Zaretskii <eliz@gnu.org> writes:
>> Date: Sat, 24 Aug 2024 04:51:16 +0000
>> From: Kepa via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
>>
>> C-RET keybinding does not work for me, and I have had to use
>> C-<return>, although M-RET does work:
>
> I think that's because RET is actually C-m, and you cannot have two
> Ctrl modifiers on the same key.
(key-valid-p "C-RET") => t
@Kepa: What do you get with:
(keymap-set dired-mode-map "C-RET" 'dired-w32explore)
Best, Arash
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: M-RET ok, C-RET wrong?
2024-08-24 7:16 ` Arash Esbati
@ 2024-08-24 7:33 ` Eli Zaretskii
2024-08-24 7:56 ` Arash Esbati
0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2024-08-24 7:33 UTC (permalink / raw)
To: help-gnu-emacs
> From: Arash Esbati <arash@gnu.org>
> Date: Sat, 24 Aug 2024 09:16:04 +0200
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > I think that's because RET is actually C-m, and you cannot have two
> > Ctrl modifiers on the same key.
>
> (key-valid-p "C-RET") => t
Ha!
> @Kepa: What do you get with:
>
> (keymap-set dired-mode-map "C-RET" 'dired-w32explore)
I'm not Kepa, but I get the same result. Although I actually tried
(keymap-set global-map "C-RET" 'dired)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: M-RET ok, C-RET wrong?
2024-08-24 7:33 ` Eli Zaretskii
@ 2024-08-24 7:56 ` Arash Esbati
2024-08-24 9:30 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Arash Esbati @ 2024-08-24 7:56 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Arash Esbati <arash@gnu.org>
>> Date: Sat, 24 Aug 2024 09:16:04 +0200
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> > I think that's because RET is actually C-m, and you cannot have two
>> > Ctrl modifiers on the same key.
>>
>> (key-valid-p "C-RET") => t
>
> Ha!
>
>> @Kepa: What do you get with:
>>
>> (keymap-set dired-mode-map "C-RET" 'dired-w32explore)
>
> I'm not Kepa, but I get the same result. Although I actually tried
>
> (keymap-set global-map "C-RET" 'dired)
I can confirm this with your recipe as well. So this is a deficiency in
`key-valid-p'?
Best, Arash
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: M-RET ok, C-RET wrong?
2024-08-24 7:56 ` Arash Esbati
@ 2024-08-24 9:30 ` Eli Zaretskii
0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2024-08-24 9:30 UTC (permalink / raw)
To: help-gnu-emacs
> From: Arash Esbati <arash@gnu.org>
> Cc: help-gnu-emacs@gnu.org
> Date: Sat, 24 Aug 2024 09:56:57 +0200
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> From: Arash Esbati <arash@gnu.org>
> >> Date: Sat, 24 Aug 2024 09:16:04 +0200
> >>
> >> Eli Zaretskii <eliz@gnu.org> writes:
> >>
> >> > I think that's because RET is actually C-m, and you cannot have two
> >> > Ctrl modifiers on the same key.
> >>
> >> (key-valid-p "C-RET") => t
> >
> > Ha!
> >
> >> @Kepa: What do you get with:
> >>
> >> (keymap-set dired-mode-map "C-RET" 'dired-w32explore)
> >
> > I'm not Kepa, but I get the same result. Although I actually tried
> >
> > (keymap-set global-map "C-RET" 'dired)
>
> I can confirm this with your recipe as well. So this is a deficiency in
> `key-valid-p'?
I guess so. Patches welcome to fix that.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: M-RET ok, C-RET wrong?
@ 2024-08-24 10:06 Kepa via Users list for the GNU Emacs text editor
2024-08-24 10:16 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Kepa via Users list for the GNU Emacs text editor @ 2024-08-24 10:06 UTC (permalink / raw)
To: Kepa via Users list for the GNU Emacs text editor
> From: Eli Zaretskii
> Subject: Re: M-RET ok, C-RET wrong?
> Date: Sat, 24 Aug 2024 12:30:13 +0300
>
> > From: Arash Esbati <arash@gnu.org>
> > Cc: help-gnu-emacs@gnu.org
> > Date: Sat, 24 Aug 2024 09:56:57 +0200
> >
> > Eli Zaretskii <eliz@gnu.org> writes:
> >
> > >> From: Arash Esbati <arash@gnu.org>
> > >> Date: Sat, 24 Aug 2024 09:16:04 +0200
> > >>
> > >> Eli Zaretskii <eliz@gnu.org> writes:
> > >>
> > >> > I think that's because RET is actually C-m, and you cannot have two
> > >> > Ctrl modifiers on the same key.
> > >>
> > >> (key-valid-p "C-RET") => t
> > >
> > > Ha!
> > >
> > >> @Kepa: What do you get with:
> > >>
> > >> (keymap-set dired-mode-map "C-RET" 'dired-w32explore)
> > >
> > > I'm not Kepa, but I get the same result. Although I actually tried
> > >
> > > (keymap-set global-map "C-RET" 'dired)
> >
> > I can confirm this with your recipe as well. So this is a deficiency in
> > `key-valid-p'?
>
> I guess so. Patches welcome to fix that.
A couple of additional details, in case they are helpful:
1. Keyboards usually have two RET keys: one near the letters and one on
the numpad. I receive two different messages when using each of them:
C-<return> is undefined (letters)
C-<enter> is undefined (numpad)
2. C-RET works in org-mode, where the following keybinding exists (I
believe by default):
Key Bindings: org-mode-map C-<return>
Best regards!
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: M-RET ok, C-RET wrong?
2024-08-24 10:06 M-RET ok, C-RET wrong? Kepa via Users list for the GNU Emacs text editor
@ 2024-08-24 10:16 ` Eli Zaretskii
0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2024-08-24 10:16 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Sat, 24 Aug 2024 12:06:23 +0200
> From: Kepa via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
>
> 1. Keyboards usually have two RET keys: one near the letters and one on
> the numpad. I receive two different messages when using each of them:
>
> C-<return> is undefined (letters)
> C-<enter> is undefined (numpad)
in my case the second on is identified as C-<kp-enter> instead.
> 2. C-RET works in org-mode, where the following keybinding exists (I
> believe by default):
> Key Bindings: org-mode-map C-<return>
Of course: if C-<return> has a binding, C-RET will invoke it. That's
what Emacs basically tells you when it says "C-<return> is undefined".
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: M-RET ok, C-RET wrong?
@ 2024-08-24 10:22 Kepa via Users list for the GNU Emacs text editor
2024-08-24 12:43 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Kepa via Users list for the GNU Emacs text editor @ 2024-08-24 10:22 UTC (permalink / raw)
To: Kepa via Users list for the GNU Emacs text editor
> From: Eli Zaretskii
> Subject: Re: M-RET ok, C-RET wrong?
> Date: Sat, 24 Aug 2024 13:16:12 +0300
>
> > Date: Sat, 24 Aug 2024 12:06:23 +0200
> > From: Kepa via Users list for the GNU Emacs text editor
> > <help-gnu-emacs@gnu.org>
> >
> > 1. Keyboards usually have two RET keys: one near the letters and one on
> > the numpad. I receive two different messages when using each of them:
> >
> > C-<return> is undefined (letters)
> > C-<enter> is undefined (numpad)
>
> in my case the second on is identified as C-<kp-enter> instead.
Just if it's useful: M-RET doesn't work with the numpad RET.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: M-RET ok, C-RET wrong?
2024-08-24 10:22 Kepa via Users list for the GNU Emacs text editor
@ 2024-08-24 12:43 ` Eli Zaretskii
0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2024-08-24 12:43 UTC (permalink / raw)
To: help-gnu-emacs
> Date: Sat, 24 Aug 2024 12:22:48 +0200
> From: Kepa via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
>
> > From: Eli Zaretskii
> > Subject: Re: M-RET ok, C-RET wrong?
> > Date: Sat, 24 Aug 2024 13:16:12 +0300
> >
> > > Date: Sat, 24 Aug 2024 12:06:23 +0200
> > > From: Kepa via Users list for the GNU Emacs text editor
> > > <help-gnu-emacs@gnu.org>
> > >
> > > 1. Keyboards usually have two RET keys: one near the letters and one on
> > > the numpad. I receive two different messages when using each of them:
> > >
> > > C-<return> is undefined (letters)
> > > C-<enter> is undefined (numpad)
> >
> > in my case the second on is identified as C-<kp-enter> instead.
>
> Just if it's useful: M-RET doesn't work with the numpad RET.
And it shouldn't.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-08-24 12:43 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-24 10:06 M-RET ok, C-RET wrong? Kepa via Users list for the GNU Emacs text editor
2024-08-24 10:16 ` Eli Zaretskii
-- strict thread matches above, loose matches on Subject: below --
2024-08-24 10:22 Kepa via Users list for the GNU Emacs text editor
2024-08-24 12:43 ` Eli Zaretskii
2024-08-24 4:51 Kepa via Users list for the GNU Emacs text editor
2024-08-24 6:21 ` Eli Zaretskii
2024-08-24 7:16 ` Arash Esbati
2024-08-24 7:33 ` Eli Zaretskii
2024-08-24 7:56 ` Arash Esbati
2024-08-24 9:30 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).