2016-12-01 3 views
0

https://github.com/fdopen/opam-repository-mingw, merlin 및 tuareg가 Cygwin에 성공적으로 설치되었습니다. 이제 윈도우 이맥스를 설치하고 모드를 Ocaml 파일을 편집 할 수 있도록 .emacs를 변경했습니다.Windows emacs가 설치된 Cygwin의 Opam

설치 방법은 다음과 같습니다. Cygwin OCaml 도구로 Windows 이맥스를 사용할 수 있습니까?

그렇다면 Cygwin에서 emacs 설정에 대한 세부 정보를 요청합니다.

업데이트 : 이제 내 init.el이

;; Added by Package.el. This must come before configurations of 
;; installed packages. Don't delete this line. If you don't want it, 
;; just comment it out by adding a semicolon to the start of the line. 
;; You may delete these explanatory comments. 
(package-initialize) 

(setenv "PATH" (concat "c:/OCaml64/bin;" (getenv "PATH"))) 
(setq exec-path (cons "c:/OCaml64/bin/" exec-path)) 
(require 'cygwin-mount) 
(cygwin-mount-activate) 

(custom-set-variables 
;; custom-set-variables was added by Custom. 
;; If you edit it by hand, you could mess it up, so be careful. 
;; Your init file should contain only one such instance. 
;; If there is more than one, they won't work right. 
'(package-selected-packages (quote (company)))) 
(custom-set-faces 
;; custom-set-faces was added by Custom. 
;; If you edit it by hand, you could mess it up, so be careful. 
;; Your init file should contain only one such instance. 
;; If there is more than one, they won't work right. 
) 


;; OCaml code 
(add-hook 
'tuareg-mode-hook 
(lambda() 
    ;; Add opam emacs directory to the load-path 
    (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 merlin-mode 
(require 'merlin) 
;; Start merlin on ocaml files 
(add-hook 'tuareg-mode-hook 'merlin-mode t) 
(add-hook 'caml-mode-hook 'merlin-mode t) 
;; Enable auto-complete 
(setq merlin-use-auto-complete-mode 'easy) 
;; Use opam switch to lookup ocamlmerlin binary 
(setq merlin-command 'opam) 
(company-mode) 
(require 'ocp-indent) 
(autoload 'utop-minor-mode "utop" "Minor mode for utop" t) 
(autoload 'utop-setup-ocaml-buffer "utop" "Toplevel for OCaml" t) 
(autoload 'merlin-mode "merlin" "Merlin mode" t) 
(utop-minor-mode) 
(company-quickhelp-mode) 
;; Important to note that setq-local is a macro and it needs to be 
;; separate calls, not like setq 
(setq-local merlin-completion-with-doc t) 
(setq-local indent-tabs-mode nil) 
(setq-local show-trailing-whitespace t) 
(setq-local indent-line-function 'ocp-indent-line) 
(setq-local indent-region-function 'ocp-indent-region) 
(merlin-mode))) 

(add-hook 'utop-mode-hook (lambda() 
      (set-process-query-on-exit-flag 
      (Get-process "utop") nil))) 

Cygwin에서-mount.el 사이트-LISP 폴더에 있습니다. 나는 .ml 파일을 열거 나 내가 M-X의 멀린 모드를 입력 할 때

답변

0

가 실제로로드 Tuareg 확신 할 때 나는 어떤 변화를 볼 수 없습니다

? *scratch*으로 이동하면 (locate-library "tuareg")을 입력하고 실행하십시오 (커서가 닫는 중괄호 뒤에있는 경우 C-xC-e 입력). 에코 영역에서 무엇을 볼 수 있습니까?

Tuareg를 설치 한 디렉토리에 tuareg-site-file.el 파일이 있어야합니다. 그렇다면 ~/.emacs 줄에 (load "/path/to/tuareg-site-file") 을 입력하면 Tuareg를 사용할 수 있습니다.

+0

수정 됨. –