Closed
Description
I can do a PR for this; just not sure if it should go into haskell-cabal.el or haskell-mode.el:
(defun haskell-guess-license ()
"Guess the license of this project.
If there is no valid .cabal file to get the license field from,
return nil."
(interactive)
(when buffer-file-name
(let ((cabal-file (haskell-cabal-find-file (file-name-directory buffer-file-name))))
(when (and cabal-file (file-readable-p cabal-file))
(with-temp-buffer
(insert-file-contents cabal-file)
(haskell-cabal-get-setting "license"))))))
One possible change would be to optionally provide the file to act on rather than making it strictly necessary to use it interactively.
Metadata
Metadata
Assignees
Labels
No labels