I have made Tuareg/Merlin work on Cygwin, and the Opam 2.2.1. I am using the emacs from Cygwin… then I had to adapt the usual .emacs/init.el
:
Note: I won’t be able to autoload tuareg/merlin. This explain the load
functions. You will see a Win/Cygwin path translation (Opam uses Win32 convention, Emacs/Cygwin, Cygwin). Perhaps I should try a Windows native Emacs.
Hope this help !
path)
(replace-regexp-in-string
"\\(.\\):/" "/cygdrive/\\1/"
(replace-regexp-in-string
"\\\\" "/"
path)))
(let ((opam-share
(ignore-errors
(win-to-cygwin
(replace-regexp-in-string
"\r$" ""
(car (process-lines "opam" "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))
(load "tuareg")
(load "merlin")
(add-hook 'tuareg-mode-hook 'merlin-mode t)
(add-to-list 'auto-mode-alist '("\\.ml[iylp]?\\'" . tuareg-mode))
(add-to-list 'auto-mode-alist '("\\.eliomi?\\'" . tuareg-mode))
(add-to-list 'interpreter-mode-alist '("ocamlrun" . tuareg-mode))
(add-to-list 'interpreter-mode-alist '("ocaml" . tuareg-mode))
))