]> Cypherpunks repositories - gostls13.git/commitdiff
misc/emacs: Kill gofmt error buffer if the buffer was formatted correctly already.
authorDominik Honnef <dominik.honnef@gmail.com>
Fri, 22 Mar 2013 03:03:27 +0000 (20:03 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 22 Mar 2013 03:03:27 +0000 (20:03 -0700)
R=adonovan, cw, patrick.allen.higgins, bradfitz
CC=golang-dev
https://golang.org/cl/7844045

misc/emacs/go-mode.el

index 93e2a6867390584cd1dcc64148261d5494f53297..9b6ea74f3aeaeb4853987abf11d18e3d42fe7358 100644 (file)
@@ -537,7 +537,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"))