Browse files

Fix inferior-haskell-load-file crash

* inf-haskell.el (inferior-haskell-find-project-root): Open buffer
  pointing to cabal file (if it exists).

inferior-haskell-load-file would crash when a buffer pointing to the
cabal file of current 'project' did not exist.
  • Loading branch information...
1 parent 4bd22d0 commit 3758409b875fd259e6d91d5d91af52019999b772 @suhailshergill suhailshergill committed Jun 5, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 inf-haskell.el
@@ -283,7 +283,11 @@ The process PROC should be associated to a comint buffer."
(defun inferior-haskell-find-project-root (buf)
(with-current-buffer buf
- (let ((cabal (inferior-haskell-cabal-of-buf buf)))
+ (let* (
+ (cabal-file (inferior-haskell-cabal-of-buf buf))
+ (cabal (when cabal-file
+ (find-file-noselect cabal-file)))
+ )
(or (when cabal
(with-current-buffer cabal
(let ((hsd (haskell-cabal-get-setting "hs-source-dirs")))

0 comments on commit 3758409

Please sign in to comment.