unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Binding C-x C-RET ?
@ 2006-05-17 14:43 Bastien
  2006-05-17 15:54 ` David Kastrup
  0 siblings, 1 reply; 5+ messages in thread
From: Bastien @ 2006-05-17 14:43 UTC (permalink / raw)


How do you bind C-x C-<RET> to a function ?

(global-set-key "\C-x\C-\\r" 'execute-extended-command) 

binds the function to C-x C-\ r with is not what i expected...

Regards,

-- 
Bastien

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

* Re: Binding C-x C-RET ?
  2006-05-17 15:54 ` David Kastrup
@ 2006-05-17 15:11   ` Bastien
  2006-05-17 16:15     ` David Kastrup
  0 siblings, 1 reply; 5+ messages in thread
From: Bastien @ 2006-05-17 15:11 UTC (permalink / raw)


David Kastrup <dak@gnu.org> writes:

> Well, \\ is a backslash.  You'd better write "\C-x\C-\r".  

I thought i need to escape "\r" the same way "\C" is escaped.

> But you could write
>
> (global-set-key (kbd "C-x C-RET") 'execute-extended-command)

... not working here.  I don't have any backtrace, since Emacs behaves
normally when evaluating the global-set-key function.

Can you reproduce that ?

-- 
Bastien

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

* Re: Binding C-x C-RET ?
  2006-05-17 16:15     ` David Kastrup
@ 2006-05-17 15:38       ` Bastien
  0 siblings, 0 replies; 5+ messages in thread
From: Bastien @ 2006-05-17 15:38 UTC (permalink / raw)


David Kastrup <dak@gnu.org> writes:

> (global-set-key (kbd "C-x <C-return>") 'execute-extended-command)
> In short, you write in quotes what C-h k C-x C-RET spews back at
> you.

Thank you very much - i should have figured that out by myself...

-- 
Lazy Bastien

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

* Re: Binding C-x C-RET ?
  2006-05-17 14:43 Binding C-x C-RET ? Bastien
@ 2006-05-17 15:54 ` David Kastrup
  2006-05-17 15:11   ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: David Kastrup @ 2006-05-17 15:54 UTC (permalink / raw)


Bastien <bastien@xxx.fr> writes:

> How do you bind C-x C-<RET> to a function ?
>
> (global-set-key "\C-x\C-\\r" 'execute-extended-command) 
>
> binds the function to C-x C-\ r with is not what i expected...

Well, \\ is a backslash.  You'd better write "\C-x\C-\r".  However,
this is not legal, as \C-\r is not a proper character and thus can't
be part of a string.  But you could write

(global-set-key (kbd "C-x C-RET") 'execute-extended-command)

instead.  This will only work in a window system, not on a tty, of
course, since C-RET still is not a proper character.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: Binding C-x C-RET ?
  2006-05-17 15:11   ` Bastien
@ 2006-05-17 16:15     ` David Kastrup
  2006-05-17 15:38       ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: David Kastrup @ 2006-05-17 16:15 UTC (permalink / raw)


Bastien <bastien@xxx.fr> writes:

> David Kastrup <dak@gnu.org> writes:
>
>> Well, \\ is a backslash.  You'd better write "\C-x\C-\r".  
>
> I thought i need to escape "\r" the same way "\C" is escaped.
>
>> But you could write
>>
>> (global-set-key (kbd "C-x C-RET") 'execute-extended-command)
>
> ... not working here.  I don't have any backtrace, since Emacs behaves
> normally when evaluating the global-set-key function.
>
> Can you reproduce that ?

Ok, so it was

(global-set-key (kbd "C-x <C-return>") 'execute-extended-command)

Sue me.

In short, you write in quotes what C-h k C-x C-RET spews back at you.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

end of thread, other threads:[~2006-05-17 16:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-17 14:43 Binding C-x C-RET ? Bastien
2006-05-17 15:54 ` David Kastrup
2006-05-17 15:11   ` Bastien
2006-05-17 16:15     ` David Kastrup
2006-05-17 15:38       ` Bastien

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).