首页 > 解决方案 > Emacs 无法识别 OCaml

问题描述

我对emacs有疑问。

我刚刚下载了,我还用终端下载了Opam和OCaml。我很确定没有问题,然后安装了tuareg。我将.eltuareg 文件放在它们必须放在的位置(在 emacs -> site-lisp 中)。但是当我打开一个新文件时test.ml,emacs 告诉我找不到该文件,并且它是directory write-protected并且它没有运行 tuareg 模式(它仍然处于基本模式)。

我已经设法更改了只读缓冲区,C-x C-q以便我可以在文件上写入,但是当我写入let x = 3;;并按下时C-x C-e,它不会执行解释。

这是我的 .emacs 文件:

;; Affichage français
(standard-display-european t)

;; Affiche le numéro de ligne et n'affiche pas celui de la colonne
(column-number-mode nil)
(line-number-mode t)

;; Les 'beep' deviennent visibles (et non plus audibles)
(setq visible-bell t)

;; Pour le mode Tuareg
(setq auto-mode-alist (cons '("\\.ml\\w?" . tuareg-mode) auto-mode-alist))
(autoload 'tuareg-mode "tuareg" "Major mode for editing Caml code" t)
(autoload 'camldebug "camldebug" "Run the Caml debugger" t)

;; Pour avoir la coloration syntaxique automatiquement
(global-font-lock-mode 1)

;;Couper sur Ctrl+W
(global-set-key (kbd "C-w" ) 'kill-line) 
;;Copier sur Ctrl+C
(global-set-key (kbd "C-c" ) 'kill-ring-save)
;;Coller sur Ctrl+V
(global-set-key (kbd "C-v" ) 'yank)
;;Annuler sur Ctrl+Z
(global-set-key (kbd "C-z" ) 'undo)
(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.
 '(exec-path (quote ("/usr/bin" "/bin" "/usr/sbin" "/sbin" "/Applications/Emacs.app/Contents/MacOS/bin" "/usr/local/bin"))))
(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.
 )

(setq mac-option-key-is-meta nil)  
(setq mac-command-key-is-meta t)  
(setq mac-command-modifier 'meta)  
(setq mac-option-modifier nil)

标签: emacsocaml

解决方案


推荐阅读