Last active
October 7, 2016 13:47
-
-
Save alexandru/9426da32ef7b0f164d308b78f1c23585 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defvar ocaml-packages '(tuareg merlin ocp-indent)) | |
| ;; Is OPAM installed? | |
| (if (equal "" (shell-command-to-string "which opam")) | |
| (user-error "WARNING: OPAM is not installed, OCaml packages are not supported!") | |
| ;; Else | |
| (progn | |
| (setq opam-share (substring (shell-command-to-string "opam config var share 2> /dev/null") 0 -1)) | |
| (add-to-list 'load-path (concat opam-share "/emacs/site-lisp")) | |
| ;; Load and install packages if needed... | |
| (dolist (p ocaml-packages) | |
| (unless (ignore-errors (require p)) | |
| (let ((command (concat "opam install " (symbol-name p) " 1>/dev/null"))) | |
| (message (concat "Executing: " command)) | |
| (shell-command command)))) | |
| ;; Settings | |
| (add-hook 'tuareg-mode-hook 'merlin-mode))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment