tags:

views:

271

answers:

2

Hi. Are there any emacs guru out there who can tell me how to bind C-B to Auctex's LaTeX compilation? This is, instead of C-c C-c RET. I'm on Ubuntu.

+8  A: 

C-c is a general prefix key which means it is hard to 'shorten' it.

You could alternatively bind you favorite function to one of the function keys. Hitting C-h k (for help on key) followed by C-c C-c reveals that the function bound to the key is TeX-command-master. So you could try something like

(global-set-key "^X9" 'TeX-command-master)

to bind this function to F9.

Dirk Eddelbuettel
+1  A: 

Dirk's answer works, but you still need to type RET after you type the function key. I haven't figure out how to invocate, say, Latex command from TeX-command-master specifically. So my hack for now use keyboard macro:

(defun my-tex-mode-hook ()
(local-set-key (kbd "<f5>") (kbd "C-c C-c C-j")))

(add-hook 'TeX-mode-hook 'my-tex-mode-hook)

(You need to use local-set-key instead of global-set-key since C-c C-c C-j might do something unexpected in other modes!)

Then you have a truly one keypress solution.

polyglot