From 1b65da4f0aa16cc0ffe31aa1f105296a51bd133e Mon Sep 17 00:00:00 2001
From: David Li
Date: Sun, 4 Mar 2018 19:50:02 -0500
Subject: Customize org-mode, OCaml/Merlin
---
init.el | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/init.el b/init.el
index 2d5e100..438abd4 100644
--- a/init.el
+++ b/init.el
@@ -216,6 +216,48 @@ This functions should be added to the hooks of major modes for programming."
(company-mode)
))
+;; Ocaml/Merlin
+
+(let ((opam-share (ignore-errors (car (process-lines "opam" "config" "var"
+ "share")))))
+ (when (and opam-share (file-directory-p opam-share))
+ ;; Register Merlin
+ (add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share))
+ (autoload 'merlin-mode "merlin" nil t nil)
+ ;; Automatically start it in OCaml buffers
+ (add-hook 'tuareg-mode-hook 'merlin-mode t)
+ (add-hook 'caml-mode-hook 'merlin-mode t)
+ ;; Use opam switch to lookup ocamlmerlin binary
+ (setq merlin-command 'opam)))
+
+;; org-mode
+
+(add-hook 'org-mode-hook
+ (lambda ()
+ (org-indent-mode t)
+ (visual-line-mode t)
+ (adaptive-wrap-prefix-mode t)
+ (flyspell-mode t)
+ ))
+
+(org-babel-do-load-languages 'org-babel-load-languages '((latex . t)))
+
+(eval-after-load "ox-latex"
+
+ ;; update the list of LaTeX classes and associated header (encoding, etc.)
+ ;; and structure
+ '(add-to-list 'org-latex-classes
+ `("beamer"
+ ,(concat "\\documentclass[presentation]{beamer}\n"
+ "[DEFAULT-PACKAGES]"
+ "[PACKAGES]"
+ "[EXTRA]\n")
+ ("\\section{%s}" . "\\section*{%s}")
+ ("\\subsection{%s}" . "\\subsection*{%s}")
+ ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
+(setq org-latex-listings t)
+;; (add-to-list 'org-latex-packages-alist '("" "listings"))
+
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
--
cgit v1.2.3