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

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

[nongnu] elpa/haskell-tng-mode 7b45c25 298/385: guard file saving


From: ELPA Syncer
Subject: [nongnu] elpa/haskell-tng-mode 7b45c25 298/385: guard file saving
Date: Tue, 5 Oct 2021 23:59:52 -0400 (EDT)

branch: elpa/haskell-tng-mode
commit 7b45c252e13481a29a11b345e696d4c1d7771d3a
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>

    guard file saving
---
 haskell-tng-extra.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/haskell-tng-extra.el b/haskell-tng-extra.el
index 58774ea..23b836c 100644
--- a/haskell-tng-extra.el
+++ b/haskell-tng-extra.el
@@ -69,7 +69,8 @@ When in a comment and called with a prefix, the comment will 
be completed."
   ;; TODO use https://github.com/purcell/reformatter.el
   ;; TODO error buffer should be easy to dismiss
   (interactive)
-  (save-buffer)
+  (when (buffer-modified-p)
+    (save-buffer))
   (unless (= 0 (call-process "stylish-haskell" nil "*stylish-haskell*" nil 
"-i" buffer-file-name))
     (pop-to-buffer "*stylish-haskell*" nil t))
   (revert-buffer t t t))
@@ -81,7 +82,8 @@ When in a comment and called with a prefix, the comment will 
be completed."
   ;; TODO error buffer should be easy to dismiss
   ;; TODO pass parameters via a buffer local variable
   (interactive)
-  (save-buffer)
+  (when (buffer-modified-p)
+    (save-buffer))
   (unless (= 0 (call-process "ormolu" nil "*ormolu*" nil
                              ;; "-p"
                              "-o" "-XTypeApplications"



reply via email to

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