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

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

[nongnu] elpa/go-mode 50fb3b2 192/495: allow users to customize the gofm


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode 50fb3b2 192/495: allow users to customize the gofmt command
Date: Sat, 7 Aug 2021 09:05:11 -0400 (EDT)

branch: elpa/go-mode
commit 50fb3b26f603f011775173326a6468b700a2973a
Author: Sameer Ajmani <sameer@golang.org>
Commit: Dominik Honnef <dominikh@fork-bomb.org>

    allow users to customize the gofmt command
---
 go-mode.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/go-mode.el b/go-mode.el
index af5d6b3..556046c 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -170,6 +170,12 @@ customize this variable to point to the wrapper script."
   :type 'string
   :group 'go)
 
+(defcustom gofmt-command "gofmt"
+  "The 'gofmt' command.  Some users may replace this with 'goimports'
+from https://github.com/bradfitz/goimports.";
+  :type 'string
+  :group 'go)
+
 (defface go-coverage-untracked
   '((t (:foreground "#505050")))
   "Coverage color of untracked code."
@@ -650,7 +656,7 @@ buffer."
     ;; We're using errbuf for the mixed stdout and stderr output. This
     ;; is not an issue because gofmt -w does not produce any stdout
     ;; output in case of success.
-    (if (zerop (call-process "gofmt" nil errbuf nil "-w" tmpfile))
+    (if (zerop (call-process gofmt-command nil errbuf nil "-w" tmpfile))
         (if (zerop (call-process-region (point-min) (point-max) "diff" nil 
patchbuf nil "-n" "-" tmpfile))
             (progn
               (kill-buffer errbuf)



reply via email to

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