[英]Integrate utop with emacs using tuareg (OCaml) on Mac OS
我正在嘗試學習OCaml,並安裝環境。 我正在使用: https : //github.com/realworldocaml/book/wiki/Installation-Instructions
我確實在最后一步[Editors,Emacs],無法使tuareg正常工作。 我下載了.tar文件,然后將所有內容復制並粘貼到主目錄中的.emacs文件中。 當我運行emacs和Mx到utop時,它給了我
Symbol的函數定義是無效的:split-string-and-unquote
但是,它在我的控制台中顯示為tuareg-abbrev,因此並不是未安裝tuareg
評論更新:您的Emacs版本為22.1, 對於tuareg
,它已經很古老且太舊了 :
這些說明已在emacs 24.2上進行了測試,並且適用於該版本及更高版本。 有一些關於早期emacsen問題的報告。
我最初的建議使用MELPA的答案如下,並且仍然適用。
您鏈接的站點建議手動安裝tuareg
的替代方法 :
使用Emacs24軟件包
作為上述設置的替代方法,這里是使用MELPA軟件包的簡化的OCaml設置。
添加到
.emacs.d/init.el
(require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
現在執行
Mx package-install
並安裝tuareg
,utop
和merlin
。然后將其余配置添加到
.emacs.d/init.el
(add-hook 'tuareg-mode-hook 'tuareg-imenu-set-imenu) (setq auto-mode-alist (append '(("\\\\.ml[ily]?$" . tuareg-mode) ("\\\\.topml$" . tuareg-mode)) auto-mode-alist)) (autoload 'utop-setup-ocaml-buffer "utop" "Toplevel for OCaml" t) (add-hook 'tuareg-mode-hook 'utop-setup-ocaml-buffer) (add-hook 'tuareg-mode-hook 'merlin-mode) (setq merlin-use-auto-complete-mode t) (setq merlin-error-after-save nil)
我認為這是一個更好的解決方案。 這樣的軟件包是Emacs的未來,它們通常更易於安裝和使用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.