The command (global-unset-key "\C-;") fails with the message: Invalid modifier in string.

Perhaps because of the special character ;. What is the proper way to unset this key?

Any other normal character works, e.g.: (global-unset-key "\C-c").


"\C-;" is not an ASCII character.

Try (global-unset-key (kbd "C-;")) or (global-unset-key [?\C-\;]).

See the Emacs manual, node Init Rebinding:

When the key sequence includes function keys or mouse button events, or non-ASCII characters such as C-= or H-a, you can use a vector to specify the key sequence...

See also the Elisp manual, node Ctl-Char Syntax.

| improve this answer | |
  • BTW, the vector representation is [?\C-\;]. – xuchunyang Jun 13 '18 at 4:49
  • @xuchunyang: Yes, I was typing that while you commented. ;-) – Drew Jun 13 '18 at 4:53
  • The first one works: (global-unset-key (kbd "C-;")). – rph Jun 13 '18 at 5:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.