首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >(错误类型的论证数组为零)启动emacs

(错误类型的论证数组为零)启动emacs
EN

Stack Overflow用户
提问于 2014-02-11 19:24:18
回答 1查看 1.8K关注 0票数 0

Emacs 24和Mac小牛,我的emacs文件如下:

代码语言:javascript
复制
(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 )。在执行以下操作后,我开始获得此错误:

代码语言:javascript
复制
opam install \
   async yojson core_extended core_bench \
   cohttp async_graphics cryptokit menhir

不知道出了什么问题,但在安装之前,我有基本相同的emacs文件,没有任何问题。现在,在emacs中,当我试图计算ocaml文件时,utop也不能正常运行。

EN

回答 1

Stack Overflow用户

发布于 2015-01-24 03:11:03

如上所述:

如果我不得不猜测的话,我会认为opam config env现在输出的东西可以抵抗函数opam-vars的操作。 运行Emacs --debug-init,您将得到回溯跟踪。 并对init文件进行平分,递归地缩小范围。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21711141

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档