1
0
mirror of https://github.com/golang/go synced 2024-09-30 14:18:32 -06:00

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 <adonovan@google.com>
This commit is contained in:
Dominik Honnef 2016-03-09 15:34:04 +01:00 committed by Alan Donovan
parent 999f507100
commit fc3ceb1825

View File

@ -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))))