emacs - Emacs 无法识别 OCaml
问题描述
我对emacs有疑问。
我刚刚下载了,我还用终端下载了Opam和OCaml。我很确定没有问题,然后安装了tuareg。我将.el
tuareg 文件放在它们必须放在的位置(在 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)
解决方案
推荐阅读
- ios - 如何将我的 UIImageView 内容保存到我的画廊?(迅速)
- google-chrome - 无法读取未定义的属性“onBoundsChanged”
- mysql - 如何编写 Mysql 查询以将变量值与列值进行比较并获得最高记录或第二高记录
- c# - Thread.Sleep & Task.Delay 的奇怪行为
- c# - Xamarin - 假地理位置
- php - 将字符串和数组的组合插入MYSQL
- java - 使用正则表达式替换字符串中的特定字符
- .net - 了解 ONION 和 N 层架构之间的区别
- python - SQLAlchemy 将行索引添加到响应
- python - OSError:[Errno 22] 无效参数: