[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode 3fdac08 233/495: use quit-window to hide the gofmt
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode 3fdac08 233/495: use quit-window to hide the gofmt error window |
Date: |
Sat, 7 Aug 2021 09:05:21 -0400 (EDT) |
branch: elpa/go-mode
commit 3fdac0816abb5b71e7b2a8d079b87430bdf20fef
Author: Felix Lange <fjl@twurst.com>
Commit: Dominik Honnef <dominik@honnef.co>
use quit-window to hide the gofmt error window
gofmt pops up a window to display syntax error messages. When one fixes
those errors and re-runs gofmt, the window shouldn't stay open. Note
that quit-window will only delete the window if it was opened
specifically for the *Gofmt Errors* buffer.
---
AUTHORS | 1 +
go-mode.el | 10 ++++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/AUTHORS b/AUTHORS
index 37c8d16..edea4ad 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -7,6 +7,7 @@ Charles Lee <zombie.fml@gmail.com>
Dominik Honnef <dominikh@fork-bomb.org>
Eric Eisner <eric.d.eisner@gmail.com>
Evan Martin <evan.martin@gmail.com>
+Felix Lange <fjl@twurst.com>
Florian Weimer <fw@deneb.enyo.de>
Istvan Marko <mi-git@kismala.com>
James Aguilar <jaguilar@google.com>
diff --git a/go-mode.el b/go-mode.el
index 09408a8..fad9e31 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -966,7 +966,7 @@ buffer."
(message "Buffer is already gofmted")
(go--apply-rcs-patch patchbuf)
(message "Applied gofmt"))
- (if errbuf (kill-buffer errbuf)))
+ (if errbuf (gofmt--kill-error-buffer errbuf)))
(message "Could not apply gofmt")
(if errbuf (gofmt--process-errors (buffer-file-name) tmpfile errbuf)))
@@ -979,7 +979,7 @@ buffer."
(if (eq gofmt-show-errors 'echo)
(progn
(message "%s" (buffer-string))
- (kill-buffer errbuf))
+ (gofmt--kill-error-buffer errbuf))
;; Convert the gofmt stderr to something understood by the compilation
mode.
(goto-char (point-min))
(insert "gofmt errors:\n")
@@ -988,6 +988,12 @@ buffer."
(compilation-mode)
(display-buffer errbuf))))
+(defun gofmt--kill-error-buffer (errbuf)
+ (let ((win (get-buffer-window errbuf)))
+ (if win
+ (quit-window t win)
+ (kill-buffer errbuf))))
+
;;;###autoload
(defun gofmt-before-save ()
"Add this to .emacs to run gofmt on the current buffer when saving:
- [nongnu] elpa/go-mode 192c9e2 195/495: Use "point" argument instead of return value of point function, (continued)
- [nongnu] elpa/go-mode 192c9e2 195/495: Use "point" argument instead of return value of point function, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 73ff68c 198/495: handle backslash in raw string in Emacs 23, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 1071ac6 209/495: simplify godef--successful-p, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode c597843 214/495: import Go's license, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode c2bf889 217/495: remove all references to upstream misc/emacs, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3fb128a 219/495: Highlight type names in function parameter list, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3300479 225/495: fix beginning-of-defun when point is near the start of a function, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 948dbeb 226/495: Issue 61., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode be58a4a 227/495: add go-mode-autoloads.el, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 0bcbcf1 228/495: refine install instructions, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3fdac08 233/495: use quit-window to hide the gofmt error window,
ELPA Syncer <=
- [nongnu] elpa/go-mode 50e7182 234/495: fix several `checkdoc' errors., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d38444d 236/495: add RĂ¼diger Sonderfeld to AUTHORS file, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 59d1e82 231/495: include link to ELPA guide in readme, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d1a8f67 237/495: bump version to 1.1.0, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode aa032d9 248/495: Add Taiki Sugawara to AUTHORS, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 64be4a3 249/495: Merge branch 'godoc_mode', ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 5d53a13 252/495: Update import path of godef, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 15d227a 253/495: gofmt: wrap external commands in `unwind-protect', ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 91c4496 254/495: go-unused-imports-lines escape dot in regexp correctly, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 0b1ec30 255/495: go-unused-imports-lines pass -e to compiler to get all errors, ELPA Syncer, 2021/08/07