Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion haskell-cabal.el
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ there is no corresponding setting with that name in the .cabal
file), then this function returns nil."
(interactive)
(when (and name buffer-file-name)
(let ((cabal-file (haskell-cabal-find-file (file-name-directory buffer-file-name))))
(let* ((dir (file-name-directory buffer-file-name))
(cabal-file (when (file-directory-p dir) (haskell-cabal-find-file dir))))
(when (and cabal-file (file-readable-p cabal-file))
(with-temp-buffer
(insert-file-contents cabal-file)
Expand Down