branch: elpa/go-mode
commit bd236e552afd0b90328a2a4aad16dbea2d6b7a9a
Author: Dominik Honnef <[email protected]>
Commit: Dominik Honnef <[email protected]>
cmd/guru: emacs: update default-directory
That way, running guru on /a/foo.go, followed by /b/bar.go won't leave
the user with a display buffer that still defaults to /a/
Change-Id: I3f9b085c6d206ac2adc269fc2009799c624c371a
Reviewed-on: https://go-review.googlesource.com/20475
Reviewed-by: Alan Donovan <[email protected]>
---
guru_import/cmd/guru/go-guru.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/guru_import/cmd/guru/go-guru.el b/guru_import/cmd/guru/go-guru.el
index 7d8ad65..f241058 100644
--- a/guru_import/cmd/guru/go-guru.el
+++ b/guru_import/cmd/guru/go-guru.el
@@ -119,9 +119,11 @@ if not already set. Mark up the output using
`compilation-mode`,
replacing each file name with a small hyperlink, and display the
result."
(let ((output (go-guru--exec mode need-scope))
- (display (get-buffer-create "*go-guru*")))
+ (display (get-buffer-create "*go-guru*"))
+ (dir default-directory))
(with-current-buffer display
(setq buffer-read-only nil)
+ (setq default-directory dir)
(erase-buffer)
(insert-buffer-substring output)
(go-guru--compilation-markup))))