【发布时间】:2014-11-05 11:25:57
【问题描述】:
当我在 emacs 中工作时,我希望 GHCI 将本地 cabal 沙箱纳入范围。 从bash来看,语法如下:
ghci -no-user-package-db -package-db .cabal-sandbox/*-packages.conf.d
我在 haskell-program-name 的定义中将标志添加到 inf-haskell.el 中,如下所示:
(defcustom haskell-program-name
(or (cond
((executable-find "hugs") "hugs \"+.\"")
((executable-find "ghci") "ghci -no-user-package-db -package-db .cabal-sandbox/*-packages.conf.d"))
"hugs \"+.\"")
"The name of the command to start the inferior Haskell process.
The command can include arguments."
;; Custom only supports the :options keyword for a few types, e.g. not
;; for string.
;; :options '("hugs \"+.\"" "ghci")
:group 'inferior-haskell
:type '(choice string (repeat string)))
但它似乎不起作用,即在重新加载 emacs 后,用C-h v haskell-program-name 检查值只是显示它等于"ghci",我需要的包当然不在范围内。
任何指针?谢谢!
【问题讨论】:
-
您应该使用
cabal repl,而不是使用沙箱手动启动ghci,并将emacs配置为使用带有(custom-set-variables '(haskell-process-type 'cabal-repl))的cabal repl -
感谢您的好主意,但这也意味着为每个小脚本设置一个 cabal 项目。我只是想尝试一些无法在全球范围内安装的库。阴谋集团,你知道的