views:

125

answers:

2

I would like to bind C-` (control-backquote) but I could not do it.

The sexp

(global-set-key "\M-`" 'other-window)

works, whereas

(global-set-key "\C-`" 'other-window)

doesn't. It fails with the "Invalid modifier in string" error.

+4  A: 

"\C-a" and similar do work because there is a ASCII code for them. There is none for C-`, simply use

(kbd "C-`")

By the way, this often more portable from one emacsen to another.

Rémi
Thanks, Works, and seems clearer than that horrible question sign.
Marcelo Morales
A: 

Since it is fair to answer my own question:

(global-set-key [?\C-`] 'other-window)

But I don't know the meaning of that extra question mark.

Marcelo Morales
The question mark means read the next bit as a character instead of something else (like a list or string or vector, etc.).
Ivan Andrus