[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode 9c2bf9b 360/495: cmd/guru: emacs: push mark in go-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode 9c2bf9b 360/495: cmd/guru: emacs: push mark in go-guru-definition |
Date: |
Sat, 7 Aug 2021 09:05:48 -0400 (EDT) |
branch: elpa/go-mode
commit 9c2bf9bd3f8bb3f5a84718238160c7d1451d3e87
Author: Dominik Honnef <dominik@honnef.co>
Commit: Dominik Honnef <dominik@honnef.co>
cmd/guru: emacs: push mark in go-guru-definition
This allows users to swap point and mark to jump between use and
definition in the same buffer, or pop-tag-mark (M-*) to jump back to the
use even between multiple buffers.
This mirrors the behaviour of godef-jump from go-mode.
Also remove an obosolete TODO and fix a typo.
Change-Id: I614090493b565acadf359ebb4c7092f4c673fd56
Reviewed-on: https://go-review.googlesource.com/20303
Reviewed-by: Alan Donovan <adonovan@google.com>
---
guru_import/cmd/guru/go-guru.el | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/guru_import/cmd/guru/go-guru.el b/guru_import/cmd/guru/go-guru.el
index def03a2..1894aa3 100644
--- a/guru_import/cmd/guru/go-guru.el
+++ b/guru_import/cmd/guru/go-guru.el
@@ -65,13 +65,6 @@
(define-key go-mode-map (kbd "C-c C-o") #'go-guru-map)
-;; TODO(dominikh): Rethink set-scope some. Setting it to a file is
-;; painful because it doesn't use find-file, and variables/~ aren't
-;; expanded. Setting it to an import path is somewhat painful because
-;; it doesn't make use of go-mode's import path completion. One option
-;; would be having two different functions, but then we can't
-;; automatically call it when no scope has been set. Also it wouldn't
-;; easily allow specifying more than one file/package.
;;;###autoload
(defun go-guru-set-scope ()
"Set the scope for the Go guru, prompting the user to edit the
@@ -100,7 +93,7 @@ specify to 'go build'."
(defun go-guru--run (mode &optional need-scope)
"Run the Go guru in the specified MODE, passing it the selected
region of the current buffer. If NEED-SCOPE, prompt for a scope
-if not already set. Mark up the output using `compilation-node`,
+if not already set. Mark up the output using `compilation-mode`,
replacing each file name with a small hyperlink, and display the
result."
(with-current-buffer (go-guru--exec mode need-scope)
@@ -167,7 +160,7 @@ a scope if not already set. Return the output buffer."
(insert "\n")
(compilation-mode)
(setq compilation-error-screen-columns nil)
-
+
;; Hide the file/line info to save space.
;; Replace each with a little widget.
;; compilation-mode + this loop = slooow.
@@ -196,7 +189,7 @@ a scope if not already set. Return the output buffer."
(incf np))) ; so we don't get stuck (e.g. on a panic stack dump)
(setq p np)))
(message nil))
-
+
(let ((w (display-buffer (current-buffer))))
(set-window-point w (point-min))))
@@ -267,6 +260,8 @@ function containing the current point."
(goto-char (point-min))
(cdr (car (json-read)))))
(desc (cdr (assoc 'desc res))))
+ (push-mark)
+ (ring-insert find-tag-marker-ring (point-marker))
(go-guru--goto-pos (cdr (assoc 'objpos res)))
(message "%s" desc)))
- [nongnu] elpa/go-mode eddbcff 277/495: Make sure we're looking at func keyword, (continued)
- [nongnu] elpa/go-mode eddbcff 277/495: Make sure we're looking at func keyword, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 45a8131 284/495: Implement go--goto-opening-curly-brace as in go-end-of-defun, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d6aa01a 287/495: Merge branch 'movement', ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 27b7415 293/495: Allow passing additional arguments to gofmt, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 1214f77 294/495: Bind go-goto-map to C-f, not C-g, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 17bd2b2 296/495: Add GOPATH detection, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 9f785cc 298/495: Document stability of the master branch, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode f8b4bf9 300/495: Add to beginning of compilation-error-regexp-alist, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode cfaa193 348/495: cmd/guru: rename oracle to guru, copying it to a single package, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4d1ab9f 347/495: cmd/oracle: improve error messages, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 9c2bf9b 360/495: cmd/guru: emacs: push mark in go-guru-definition,
ELPA Syncer <=
- [nongnu] elpa/go-mode 5ef1d53 355/495: cmd/guru: use byte (not rune) count in -modified archive, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 60ed26e 368/495: cmd/guru: emacs: only check modified buffers with file names, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d209550 353/495: cmd/guru: emacs: minor changes to keybindings, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 6ac5669 372/495: cmd/guru: emacs: interpret byte offsets correctly, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode afb2a24 382/495: go.tools: use golang.org/x/... import paths, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3a82342 379/495: Regenerate AUTHORS, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 8991b83 384/495: refactor/rename: emacs: kill go-rename buffer correctly, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode adea2e5 395/495: Make go-guru-build-tags a list of strings, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d511e35 402/495: Replace obsolete one-argument form of ‘looking-back’., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 35f6826 404/495: Bump version to 1.5.0, ELPA Syncer, 2021/08/07