[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode 27b7415 293/495: Allow passing additional argument
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode 27b7415 293/495: Allow passing additional arguments to gofmt |
Date: |
Sat, 7 Aug 2021 09:05:34 -0400 (EDT) |
branch: elpa/go-mode
commit 27b74155dc2896a1809c905a7326b1d6d36014f3
Author: Dominik Honnef <dominik@honnef.co>
Commit: Dominik Honnef <dominik@honnef.co>
Allow passing additional arguments to gofmt
Closes gh-123
---
NEWS | 20 ++++++++++++--------
go-mode.el | 10 +++++++++-
2 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/NEWS b/NEWS
index 39320b3..32006f7 100644
--- a/NEWS
+++ b/NEWS
@@ -18,19 +18,23 @@ go-mode-1.4.0 (???)
- go-goto-return-values
- go-goto-method-receiver
- * Add new variable go-packages-function, which allows choosing
- between different ways of finding installed packages. Currently,
- go-packages-native (the default) and go-packages-go-list are
- provided.
+ * Add new customizable variable go-packages-function, which allows
+ choosing between different ways of finding installed packages.
+ Currently, go-packages-native (the default) and go-packages-go-list
+ are provided.
- * Add new variable gofmt-is-goimports. If gofmt-command is set to a
- value that invokes goimports instead of gofmt, this variable needs
- to be set to t. Otherwise, goimports will not be able to add
- imports for vendored packages.
+ * Add new customizable variable gofmt-is-goimports. If gofmt-command
+ is set to a value that invokes goimports instead of gofmt, this
+ variable needs to be set to t. Otherwise, goimports will not be
+ able to add imports for vendored packages.
Setting it to t while not using goimports will break gofmt, as
gofmt doesn't support goimports' -srcdir flag.
+ * Add new customizable variable gofmt-args, a list of strings that
+ will be passed to gofmt as additional arguments. Primarily this
+ allows using the -s flag with gofmt.
+
go-mode-1.3.1 (2015-07-03)
* The 1.3.0 release forgot to update the version in the package
diff --git a/go-mode.el b/go-mode.el
index ba9cc96..e86f06d 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -201,6 +201,11 @@ support for vendored packages."
:type 'boolean
:group 'go)
+(defcustom gofmt-args nil
+ "Additional arguments to pass to gofmt."
+ :type '(repeat string)
+ :group 'go)
+
(defcustom gofmt-show-errors 'buffer
"Where to display gofmt error output.
It can either be displayed in its own buffer, in the echo area, or not at all.
@@ -1035,7 +1040,10 @@ with goflymake \(see URL
`https://github.com/dougm/goflymake'), gocode
(setq our-gofmt-args
(append our-gofmt-args
(list "-srcdir" (file-name-directory (file-truename
buffer-file-name))))))
- (setq our-gofmt-args (append our-gofmt-args (list "-w" tmpfile)))
+ (setq our-gofmt-args (append our-gofmt-args
+ gofmt-args
+ (list "-w" tmpfile)))
+ (message "Calling gofmt: %s %s" gofmt-command our-gofmt-args)
;; 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.
- [nongnu] elpa/go-mode 8baa836 251/495: Don't break fontification when limiting point, (continued)
- [nongnu] elpa/go-mode 8baa836 251/495: Don't break fontification when limiting point, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode dccb56c 256/495: go-unused-imports-lines: only compile the current file, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d91a157 257/495: Add goto functions for working with function signatures, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 11e7b4e 259/495: Fix copy-pasted docstring of go-goto-arguments, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode b261fac 263/495: Add support for (nested) anonymous functions in go-goto-function, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 6e8373e 267/495: go-goto-docstring: handle empty comments, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d1ebde8 271/495: Rename go--get-function-name to go--function-name, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode eddbcff 277/495: Make sure we're looking at func keyword, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 45a8131 284/495: Implement go--goto-opening-curly-brace as in go-end-of-defun, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d6aa01a 287/495: Merge branch 'movement', ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 27b7415 293/495: Allow passing additional arguments to gofmt,
ELPA Syncer <=
- [nongnu] elpa/go-mode 1214f77 294/495: Bind go-goto-map to C-f, not C-g, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 17bd2b2 296/495: Add GOPATH detection, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 9f785cc 298/495: Document stability of the master branch, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode f8b4bf9 300/495: Add to beginning of compilation-error-regexp-alist, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode cfaa193 348/495: cmd/guru: rename oracle to guru, copying it to a single package, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4d1ab9f 347/495: cmd/oracle: improve error messages, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 9c2bf9b 360/495: cmd/guru: emacs: push mark in go-guru-definition, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 5ef1d53 355/495: cmd/guru: use byte (not rune) count in -modified archive, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 60ed26e 368/495: cmd/guru: emacs: only check modified buffers with file names, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d209550 353/495: cmd/guru: emacs: minor changes to keybindings, ELPA Syncer, 2021/08/07