From 1385b47f963186661d82a46b986f5c865fc9327f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Louwrink?= Date: Wed, 29 Jul 2015 11:16:55 +0200 Subject: [PATCH] Determine proper default Cabal directory when no Cabal project This commit fixes #784. When `haskell-process-load-or-reload-prompt` is set to `nil`, `haskell-cabal-get-dir` used to return `nil` when there is no Cabal project. Now it returns `default-directory` instead. --- haskell-cabal.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haskell-cabal.el b/haskell-cabal.el index 54e590ebd..64ca13961 100644 --- a/haskell-cabal.el +++ b/haskell-cabal.el @@ -190,7 +190,7 @@ file), then this function returns nil." "Get the Cabal dir for a new project. Various ways of figuring this out, and indeed just prompting the user. Do them all." (let* ((file (haskell-cabal-find-file)) - (dir (when file (file-name-directory file)))) + (dir (if file (file-name-directory file) default-directory))) (haskell-utils-read-directory-name (format "Cabal dir%s: " (if file (format " (guessed from %s)" (file-relative-name file)) "")) dir)))