Emacs go-mode gofmt diff problem
Shit. In emacs golang
command doesn't work on Microsoft Windows because it's trying to call unix shell command
diff. Sloppy, plus, it shouldn't need to.
gofmt command itself supports diff, by
now write my own. emacs lisp command to call gofmt. golang
(defun xah-gofmt () "Reformat current file by calling shell command gofmt. URL `http://ergoemacs.org/misc/emacs_go-mode_gofmt_diff.html' Version 2021-01-15" (interactive) (let ((xfname (buffer-file-name))) (when xfname (when (buffer-modified-p ) (save-buffer)) (shell-command (format "gofmt -w %s" xfname)))))