;; Open in ConTeXt mode
(add-hook 'LaTeX-mode-hook 'TeX-PDF-mode) ;; AucTeX turn on PDF mode by default
(add-hook 'LaTeX-mode-hook (function turn-on-reftex)) ;; Turn on RefTeX when AucTeX loads
(add-hook 'ConTeXt-mode-hook 'yas/minor-mode-on) ;; Turn on YaSnippet minor mode in ConTeXt-en-mode
(add-hook 'ConTeXt-mode-hook (function turn-on-reftex)) ;; Turn on RefTeX when AucTeX loads
(setq TeX-default-mode 'context-mode) ;; Make context-mode the default tex-mode
(setq reftex-plug-into-AUCTeX t) ;; Turn on RefTeX when AucTeX loads
(add-hook 'TeX-mode-hook '(lambda () (TeX-fold-mode 1)))
;; Add option for MKIV and make it the default for C-c C-c
(add-hook 'ConTeXt-mode-hook (lambda()
(add-to-list 'TeX-command-list '("ConTeXt MKIV" "context %t" TeX-run-TeX nil (context-mode) ))
(setq TeX-command-default "ConTeXt MKIV")
(setq TeX-save-query nil )
))