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

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

[nongnu] elpa/go-mode 2ec688b 143/495: kill gofmt errbuf if the buffer w


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode 2ec688b 143/495: kill gofmt errbuf if the buffer was already formatted
Date: Sat, 7 Aug 2021 09:05:00 -0400 (EDT)

branch: elpa/go-mode
commit 2ec688ba1a0e8172126f37208caf3689a24cb559
Author: Dominik Honnef <dominikh@fork-bomb.org>
Commit: Dominik Honnef <dominikh@fork-bomb.org>

    kill gofmt errbuf if the buffer was already formatted
    
    Closes gh-32
---
 go-mode.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/go-mode.el b/go-mode.el
index 9a2fb36..7318328 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -552,7 +552,9 @@ buffer."
     ;; output in case of success.
     (if (zerop (call-process "gofmt" nil errbuf nil "-w" tmpfile))
         (if (zerop (call-process-region (point-min) (point-max) "diff" nil 
patchbuf nil "-n" "-" tmpfile))
-            (message "Buffer is already gofmted")
+            (progn
+              (kill-buffer errbuf)
+              (message "Buffer is already gofmted"))
           (go--apply-rcs-patch patchbuf)
           (kill-buffer errbuf)
           (message "Applied gofmt"))



reply via email to

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