Emacs 24和Mac小牛,我的emacs文件如下:
(setq debug-on-error t)
;; -- common-lisp compatibility if not added earlier in your .emacs
(require 'cl)
;; -- Tuareg mode -----------------------------------------
;; Add Tuareg to your search path
(add-to-list
'load-path
;; Change the path below to be wherever you've put your tuareg installation.
(expand-file-name "~/.elisp/tuareg"))
(require 'tuareg)
(setq auto-mode-alist
(append '(("\\.ml[ily]?$" . tuareg-mode))
auto-mode-alist))
;; -- Tweaks for OS X -------------------------------------
;; Tweak for problem on OS X where Emacs.app doesn't run the right
;; init scripts when invoking a sub-shell
(cond
((eq window-system 'ns) ; macosx
;; Invoke login shells, so that .profile or .bash_profile is read
(setq shell-command-switch "-lc")))
;; -- opam and utop setup --------------------------------
;; Setup environment variables using opam
(defun opam-vars ()
(let* ((x (shell-command-to-string "opam config env"))
(x (split-string x "\n"))
(x (remove-if (lambda (x) (equal x "")) x))
(x (mapcar (lambda (x) (split-string x ";")) x))
(x (mapcar (lambda (x) (car x)) x))
(x (mapcar (lambda (x) (split-string x "=")) x))
)
x))
(dolist (var (opam-vars))
(setenv (car var) (substring (cadr var) 1 -1)))
;; The following simpler alternative works as of opam 1.1
;; (dolist
;; (var (car (read-from-string
;; (shell-command-to-string "opam config env --sexp"))))
;; (setenv (car var) (cadr var)))
;; Update the emacs path
(setq exec-path (split-string (getenv "PATH") path-separator))
;; Update the emacs load path
(push (concat (getenv "OCAML_TOPLEVEL_PATH")
"/../../share/emacs/site-lisp") load-path)
;; Automatically load utop.el
(autoload 'utop "utop" "Toplevel for OCaml" t)
(autoload 'utop-setup-ocaml-buffer "utop" "Toplevel for OCaml" t)
(add-hook 'tuareg-mode-hook 'utop-setup-ocaml-buffer)任何帮助修复这个错误都是很好的。谢谢!
不:我确实有图阿雷格模式,我说它是(in~/..elisp/ tuareg )。在执行以下操作后,我开始获得此错误:
opam install \
async yojson core_extended core_bench \
cohttp async_graphics cryptokit menhir不知道出了什么问题,但在安装之前,我有基本相同的emacs文件,没有任何问题。现在,在emacs中,当我试图计算ocaml文件时,utop也不能正常运行。
发布于 2015-01-24 03:11:03
如上所述:
如果我不得不猜测的话,我会认为opam config env现在输出的东西可以抵抗函数
opam-vars的操作。 运行Emacs --debug-init,您将得到回溯跟踪。 并对init文件进行平分,递归地缩小范围。
https://stackoverflow.com/questions/21711141
复制相似问题