branch: elpa/go-mode
commit 5bd8efab64352dccf31dbc99c4fc96d3b985ef27
Author: Simon Law <[email protected]>
Commit: Dominik Honnef <[email protected]>
godoc-gogetdoc works with modules
godoc-gogetdoc now works with modules outside GOPATH by creating a
temporary buffer using with-temp-buffer, which preserves
default-directory.
---
go-mode.el | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/go-mode.el b/go-mode.el
index 72cb8ae..21d01ff 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -298,9 +298,7 @@ You can install gogetdoc with 'go get -u
github.com/zmb3/gogetdoc'."
(error "Cannot use gogetdoc on a buffer without a file name"))
(let ((posn (format "%s:#%d" (file-truename buffer-file-name) (1-
(position-bytes point))))
(out (godoc--get-buffer "<at point>")))
- (with-current-buffer (get-buffer-create "*go-gogetdoc-input*")
- (setq buffer-read-only nil)
- (erase-buffer)
+ (with-temp-buffer
(go--insert-modified-files)
(call-process-region (point-min) (point-max) "gogetdoc" nil out nil
"-modified"