Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Binding C-; in Emacs

How can I bind a function to C-; in Emacs? I tried to use bracket notation with an escape character:

(global-set-key [C-\;] 'my-func)

and kbd:

(global-set-key (kbd "<C-;>") 'my-func)

Is it not possible? If so, then why acknowledge the existence of the chord (C-; is undefined)?

I am running Emacs 24.1.1.

like image 626
Dodgie Avatar asked Feb 03 '26 18:02

Dodgie


1 Answers

(global-set-key (kbd "C-;") 'my-func) seems to avoid problems with the comment character and escaping.

like image 126
JSON Avatar answered Feb 05 '26 09:02

JSON