我希望GHCI有當地的cabal沙箱範圍,當我在emacs工作。 從bash中,語法如下:ghci cabal沙箱標誌Emacs Haskell劣勢
ghci -no-user-package-db -package-db .cabal-sandbox/*-packages.conf.d
我添加了標誌,以INF-haskell.el的haskell-program-name
的定義中,如下所示:
(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)))
,但它不」 t似乎工作,即重新加載emacs後,檢查值C-h v haskell-program-name
只顯示它等於"ghci"
,我需要的包當然不在範圍內。 任何指針?謝謝!
您應該使用'cabal repl'而不是手動啓動帶有沙盒的ghci,並配置emacs以使用cabal repl('custom-set-variables'(haskell-process-type'cabal-repl))' – user2407038 2014-11-06 00:26:32
Thanks for這個好主意,但這也意味着爲每一個小腳本建立一個cabal項目。我只想嘗試一些我無法在全球安裝的庫。 Cabal地獄,你知道 – ocramz 2014-11-06 18:55:47