branch: elpa/haskell-tng-mode commit 5c157fb5ba3ec6599445dcaf013a6f4d05bd863a Author: Tseen She <ts33n....@gmail.com> Commit: Tseen She <ts33n....@gmail.com>
rigid ormolu support --- haskell-tng-contrib.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/haskell-tng-contrib.el b/haskell-tng-contrib.el index cc2ec16..c4123c6 100644 --- a/haskell-tng-contrib.el +++ b/haskell-tng-contrib.el @@ -31,6 +31,23 @@ (revert-buffer t t t)) ;;;###autoload +(defun haskell-tng-stylish-ormolu () + "Apply `ormolu' rules." + ;; TODO use https://github.com/purcell/reformatter.el + ;; TODO error buffer should be easy to dismiss + ;; TODO pass parameters via a buffer local variable + (interactive) + (save-buffer) + (unless (= 0 (call-process "ormolu" nil "*ormolu*" nil + "-o" "-XTypeApplications" + "-o" "-XBangPatterns" + "-o" "-XPatternSynonyms" + "-c" "-m" "inplace" + buffer-file-name)) + (pop-to-buffer "*ormolu*" nil t)) + (revert-buffer t t t)) + +;;;###autoload (defun haskell-tng-stack2cabal () "Prepare a stack project for use with cabal." (interactive)