Skip to content
Browse files

(inferior-haskell-find-project-root): Use it.

Ignore-this: c1a05ba1dba04d974bd42a2c3e075c8d

darcs-hash:20070926215741-c2f2e-b80cec4047a1c0380d9226747aad5253897c0b4c.gz
  • Loading branch information...
1 parent 238b94c commit f11a557dc9c38ff17fcd43962fd5045a15629ea0 monnier committed Sep 26, 2007
Showing with 6 additions and 7 deletions.
  1. +2 −0 ChangeLog
  2. +4 −7 inf-haskell.el
View
2 ChangeLog
@@ -2,6 +2,8 @@
* haskell-cabal.el (haskell-cabal-get-setting): New function.
+ * inf-haskell.el (inferior-haskell-find-project-root): Use it.
+
* haskell-c.el: New file.
2007-09-17 Stefan Monnier <monnier@iro.umontreal.ca>
View
11 inf-haskell.el
@@ -220,20 +220,17 @@ The process PROC should be associated to a comint buffer."
(let ((cabal (inferior-haskell-cabal-of-buf buf)))
(or (when cabal
(with-current-buffer cabal
- (save-excursion
- (goto-char (point-min))
- (if (let ((case-fold-search t))
- (not (re-search-forward "^hs-source-dirs:[ \t]*\\(.*\\)"
- nil t)))
+ (let ((hsd (haskell-cabal-get-setting "hs-source-dirs")))
+ (if (null hsd)
;; If there's a Cabal file with no Hs-Source-Dirs, then
;; just use the Cabal file's directory.
default-directory
;; If there is an HSD, then check that it's an existing
;; dir (otherwise, it may be a list of dirs and we don't
;; know what to do with those). If it doesn't exist, then
;; give up.
- (let ((hsd (expand-file-name (match-string 1))))
- (if (file-directory-p hsd) hsd))))))
+ (setq hsd (expand-file-name hsd))
+ (if (file-directory-p hsd) hsd)))))
;; If there's no Cabal file or it's not helpful, try to look for
;; a "module" statement and count the number of "." in the
;; module name.

0 comments on commit f11a557

Please sign in to comment.
Something went wrong with that request. Please try again.