From: Dominik Honnef Date: Fri, 22 Mar 2013 03:03:27 +0000 (-0700) Subject: misc/emacs: Kill gofmt error buffer if the buffer was formatted correctly already. X-Git-Tag: go1.1rc2~390 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c7ad7a1af4ed8cb832f429eb57da182daf8427dd;p=gostls13.git misc/emacs: Kill gofmt error buffer if the buffer was formatted correctly already. R=adonovan, cw, patrick.allen.higgins, bradfitz CC=golang-dev https://golang.org/cl/7844045 --- diff --git a/misc/emacs/go-mode.el b/misc/emacs/go-mode.el index 93e2a68673..9b6ea74f3a 100644 --- a/misc/emacs/go-mode.el +++ b/misc/emacs/go-mode.el @@ -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"))