When working in LaTeX (specifically, with AUCTeX), I want to bind the following functionality to the C-{
and C-}
keys:
C-{
: insert\begingroup
followed by a newlineC-}
: insert\endgroup
followed by a newline
As per this thread on LaTeX Stack Exchange I've tried the following:
(eval-after-load "latex"
'(progn
(define-key LaTeX-mode-map (kbd "C-{") "\\begingroup\n")
(define-key LaTeX-mode-map (kbd "C-}") "\\endgroup\n")))
It doesn't work, however, and if I try C-h k C-}
nothing happens. How can I make my keybindings work?
I have tested the above behavior in at least three modes, Emacs-Lisp, LaTeX (AucTex) and XML mode.
I am using GNU Emacs 24 in Ubuntu 14.04.
UPDATE 1
I completely emptied my init file and then restarted emacs. The odd behavior persists.
UPDATE 2
All the proposed solutions, including my original one, has started to work.
I am without a clue.
emacs -Q
. This will prevent any customizations from being loaded.