I have a custom
comment-dwim-line command that I want to bind to the key combination
C-M-; (in other words,
; buttons pressed simultaneously). The built-in
comment-dwim command is bound to
M-; by default, and I want to keep this binding.
So far I have tried:
(global-set-key "\C-M-;" 'comment-dwim-line)
global-set-key: Key sequence RET - ; starts with non-prefix key RET.
(global-set-key "\C-\M-;" 'comment-dwim-line)
load-with-code-conversion: Invalid modifier in string.
(global-set-key "C-\M-;" 'comment-dwim-line)
global-set-key: Key sequence C - M-; starts with non-prefix key C.
(global-set-key [?\C-M-;] 'next-line)
read--expression: Invalid read syntax: "?".
(global-set-key [?\C-\M-;] 'next-line)
Symbol's value as variable is void: M-.
(global-set-key (kbd "C-M-;") 'comment-dwim-line)
does not throw an error, but the key binding has no effect: when I actually press
C-M-; it behaves the same as
comment-dwim is called).
I am using Emacs 24.4 on Mac OS X 10.10, running in iTerm2.