[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode 6a92c3b 349/495: cmd/guru: clean ups to command-li
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode 6a92c3b 349/495: cmd/guru: clean ups to command-line interface |
Date: |
Sat, 7 Aug 2021 09:05:46 -0400 (EDT) |
branch: elpa/go-mode
commit 6a92c3b1b280a9e33afdd06cd6da1615c7e14df9
Author: Alan Donovan <alan@alandonovan.net>
Commit: Dominik Honnef <dominik@honnef.co>
cmd/guru: clean ups to command-line interface
-pos is now a positional argument; -scope is now a flag.
Tidy up usage message.
Update Vim and Emacs scripts and test
Remove call to GOMAXPROCS.
Use log.{SetPrefix,SetFlags} and Fatalf
Change-Id: I3786ed83aecb17d622b29d2a538a374f813f0adc
Reviewed-on: https://go-review.googlesource.com/19438
Reviewed-by: Michael Matloob <matloob@golang.org>
---
guru_import/cmd/guru/guru.el | 28 ++++++++++++----------------
1 file changed, 12 insertions(+), 16 deletions(-)
diff --git a/guru_import/cmd/guru/guru.el b/guru_import/cmd/guru/guru.el
index e33c30c..d00f44c 100644
--- a/guru_import/cmd/guru/guru.el
+++ b/guru_import/cmd/guru/guru.el
@@ -2,20 +2,16 @@
;;; Integration of the Go 'guru' analysis tool into Emacs.
;;;
;;; To install the Go guru, run:
-;;; % export GOROOT=... GOPATH=...
-;;; % go get golang.org/x/tools/cmd/guru
-;;; % mv $GOPATH/bin/guru $GOROOT/bin/
+;;; $ go get golang.org/x/tools/cmd/guru
;;;
;;; Load this file into Emacs and set go-guru-scope to your
;;; configuration. Then, find a file of Go source code, enable
;;; go-guru-mode, select an expression of interest, and press `C-c C-o d'
;;; (for "describe") or run one of the other go-guru-xxx commands.
-;;;
-;;; TODO(adonovan): simplify installation and configuration by making
-;;; guru a subcommand of 'go tool'.
(require 'compile)
(require 'go-mode)
+(require 'simple)
(require 'cl)
(defgroup go-guru nil
@@ -99,14 +95,14 @@ file name with a small hyperlink. Display the result."
(string-equal "" go-guru-scope)
(go-guru-set-scope))
(let* ((filename (file-truename buffer-file-name))
- (posflag (if (use-region-p)
- (format "-pos=%s:#%d,#%d"
- filename
- (1- (go--position-bytes (region-beginning)))
- (1- (go--position-bytes (region-end))))
- (format "-pos=%s:#%d"
- filename
- (1- (position-bytes (point))))))
+ (posn (if (use-region-p)
+ (format "%s:#%d,#%d"
+ filename
+ (1- (go--position-bytes (region-beginning)))
+ (1- (go--position-bytes (region-end))))
+ (format "%s:#%d"
+ filename
+ (1- (position-bytes (point))))))
(env-vars (go-root-and-paths))
(goroot-env (concat "GOROOT=" (car env-vars)))
(gopath-env (concat "GOPATH=" (mapconcat #'identity (cdr env-vars)
":"))))
@@ -114,8 +110,8 @@ file name with a small hyperlink. Display the result."
(setq buffer-read-only nil)
(erase-buffer)
(insert "Go Guru\n")
- (let ((args (append (list go-guru-command nil t nil posflag mode)
- (split-string go-guru-scope " " t))))
+ (let ((args (list go-guru-command nil t nil
+ "-scope" go-guru-scope mode posn)))
;; Log the command to *Messages*, for debugging.
(message "Command: %s:" args)
(message nil) ; clears/shrinks minibuffer
- [nongnu] elpa/go-mode cbf7274 343/495: x/tools/oracle: add whicherrs query mode, (continued)
- [nongnu] elpa/go-mode cbf7274 343/495: x/tools/oracle: add whicherrs query mode, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 01dff21 358/495: cmd/guru: emacs: package.el compatibility changes, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode dc424ef 361/495: cmd/guru: emacs: add default key binding for whicherrs, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 6bfbd41 371/495: cmd/guru: emacs: report most specific element in expand-region, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 9753f6a 342/495: go.tools: use golang.org/x/... import paths, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode aa9a40c 351/495: cmd/guru: in Emacs, change 'definition' to jump directly, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 95e7a6f 377/495: cmd/guru: emacs: Use cl-lib.el instead of cl.el, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 2e9ec69 376/495: cmd/guru: update Emacs installation documentation, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 37f595f 365/495: cmd/guru: emacs: support running on nameless buffers, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 9d5f10a 366/495: cmd/guru: emacs: store output in separate buffer, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 6a92c3b 349/495: cmd/guru: clean ups to command-line interface,
ELPA Syncer <=
- [nongnu] elpa/go-mode b2837e7 345/495: cmd/oracle: expect oracle binary beneath $GOBIN, $GOPATH/bin, or $GOROOT/bin, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode f1b8ed0 337/495: go.tools/cmd/oracle: use -pos=file:#start, #end syntax to indicate half-open [start, end) extent of byte offsets., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7580ac3 359/495: cmd/guru: emacs: allow passing tags to guru, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 90aac96 381/495: cmd/gorename: a precise, type-aware renaming tool for Go identifiers., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 34e7efe 356/495: cmd/guru: emacs: do not shrink results window, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3da5817 383/495: refactor/rename: allow passing -force flag from Emacs, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3448304 340/495: go.tools/oracle: change -mode argument into subcommand., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 9d94107 328/495: Release version 1.4.0, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 6bb38ea 387/495: refactor/rename: emacs: set up autoloading of go-rename function, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 221e967 390/495: Move go-rename.el to top level, ELPA Syncer, 2021/08/07