[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode a6717a1 318/495: Fix filename replacement in gofmt
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode a6717a1 318/495: Fix filename replacement in gofmt error buffer |
Date: |
Sat, 7 Aug 2021 09:05:39 -0400 (EDT) |
branch: elpa/go-mode
commit a6717a1bd9b5cdbec861f77e577301260c8d257b
Author: Will <will@glozer.net>
Commit: Dominik Honnef <dominik@honnef.co>
Fix filename replacement in gofmt error buffer
goimport's new -srcdir option rewrites the directory but not the
filename causing the regexp search & replace to fail
Closes: gh-129
Closes: gh-130 [via git-merge-pr]
---
AUTHORS | 1 +
go-mode.el | 8 ++++++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/AUTHORS b/AUTHORS
index 75f1cc9..eefc714 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -32,4 +32,5 @@ Scott Lawrence <bytbox@gmail.com>
Steven Elliot Harris <seharris@gmail.com>
Taiki Sugawara <buzz.taiki@gmail.com>
Viacheslav Chimishuk <vchimishuk@yandex-team.ru>
+Will <will@glozer.net>
Yasuyuki Oka <yasuyk@gmail.com>
diff --git a/go-mode.el b/go-mode.el
index dac2a38..f3ca05e 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -1117,8 +1117,12 @@ with goflymake \(see URL
`https://github.com/dougm/goflymake'), gocode
(search-forward "flag provided but not defined: -srcdir" nil t)))
(insert "Your version of goimports is too old and doesn't support
vendoring. Please update goimports!\n\n"))
(insert "gofmt errors:\n")
- (while (search-forward-regexp (concat "^\\(" (regexp-quote tmpfile)
"\\):") nil t)
- (replace-match (file-name-nondirectory filename) t t nil 1))
+ (let ((truefile
+ (if (gofmt--is-goimports-p)
+ (concat (file-name-directory filename)
(file-name-nondirectory tmpfile))
+ tmpfile)))
+ (while (search-forward-regexp (concat "^\\(" (regexp-quote truefile)
"\\):") nil t)
+ (replace-match (file-name-nondirectory filename) t t nil 1)))
(compilation-mode)
(display-buffer errbuf))))
- [nongnu] elpa/go-mode 093a492 274/495: Rename go--in-function-p to go--below-anonymous-function, (continued)
- [nongnu] elpa/go-mode 093a492 274/495: Rename go--in-function-p to go--below-anonymous-function, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 2f302d2 279/495: Update go--goto-opening-curly-brace to handle more cases, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 29f3380 280/495: Remove trailing whitespace in go-mode.el, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode dd46d4f 281/495: Modify go--goto-opening-curly-brace to use end-of-defun, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 6fc1f35 282/495: Move go-goto keymap to the rest of the keymap, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 400d2ae 289/495: Add a changelog, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 0f9b5c5 291/495: Add go-packages-function and go-packages-go-list, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 8c884f3 292/495: Support goimports' new -srcdir flag, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode c65dd39 297/495: Complain about outdated goimports, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 0b5b29d 316/495: Reformat code, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode a6717a1 318/495: Fix filename replacement in gofmt error buffer,
ELPA Syncer <=
- [nongnu] elpa/go-mode 50bceae 326/495: Use HTTPS with go-play-region, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 49521d5 310/495: Add go-reset-gopath, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode b767500 325/495: Set compilation-error-screen-columns to nil, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 15ea9a4 320/495: No longer provide a default in M-x godoc, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 22cbf11 321/495: Support unsaved buffers with gogetdoc, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 0b25cb5 327/495: Generate HTTPS URL for playground entry, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode f63d982 323/495: Make godoc interactive again, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 218d8c5 346/495: cmd/oracle: emacs: look for oracle on $PATH and nowhere else, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode aa733d8 339/495: go.tools/oracle: turn emacs integration into minor-mode, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode cbf7274 343/495: x/tools/oracle: add whicherrs query mode, ELPA Syncer, 2021/08/07