I have a problem with following key binding:
(global-set-key (kbd "C-/") 'comment-or-uncomment-region)
Actually, it is ignored by Emacs so undo is executed instead. I'm running Emacs in gui mode.
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityThanks to describe-key
, I found that / is interprpeted as a <kp-divide>
, so this keybind is working like a charm now. (thanks lawlist)
(global-set-key (kbd "C-<kp-divide>") 'comment-or-uncomment-region)
undo-tree
, which would override global bindings? TypeM-x describe-key
orC-h k
and then your keyboard shortcut and verify that the actual function being called is exactlyundo
or something else. Also, check your*Messages*
buffer for error messages after starting Emacs -- an error in the init file can cause Emacs to stop loading the file once it reaches that particular point.emacs -Q
(no init file)? If not, recursively bisect your init file to find the culprit.M-;
binding which does what you want by default already.