emacs-elpa-diffs
[Top][All Lists]
Advanced

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]