emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/haskell-tng-mode 5c157fb 255/385: rigid ormolu support


From: ELPA Syncer
Subject: [nongnu] elpa/haskell-tng-mode 5c157fb 255/385: rigid ormolu support
Date: Tue, 5 Oct 2021 23:59:42 -0400 (EDT)

branch: elpa/haskell-tng-mode
commit 5c157fb5ba3ec6599445dcaf013a6f4d05bd863a
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]