[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode 205672f 322/495: Use separate godoc commands for g
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode 205672f 322/495: Use separate godoc commands for godoc and godoc-at-point |
Date: |
Sat, 7 Aug 2021 09:05:40 -0400 (EDT) |
branch: elpa/go-mode
commit 205672ff1f4e5637fc5613e9304a1cecc35df254
Author: Dominik Honnef <dominik@honnef.co>
Commit: Dominik Honnef <dominik@honnef.co>
Use separate godoc commands for godoc and godoc-at-point
godoc-and-godef needs to use godoc and doesn't support go doc.
Closes gh-127
---
NEWS | 13 +++++++++++--
go-mode.el | 27 +++++++++++++++++++--------
2 files changed, 30 insertions(+), 10 deletions(-)
diff --git a/NEWS b/NEWS
index 77358af..8e21c79 100644
--- a/NEWS
+++ b/NEWS
@@ -45,8 +45,11 @@ go-mode-1.4.0 (???)
it had when Emacs started.
* Add customizable variable godoc-command, which allows choosing
- between using godoc and go doc. It defaults to go doc, which
- differs from prior versions which always used godoc.
+ between using godoc and go doc, and generally specifying
+ alternative paths to those tools.
+
+ It defaults to go doc, which differs from prior versions which always
+ used godoc.
* Add customizable variable godoc-use-completing-read, which allows
turning on or off the completion of import paths in the godoc
@@ -68,6 +71,12 @@ go-mode-1.4.0 (???)
choosing between strategies for finding an identifier's
documentation.
+ * Add new function godoc-and-godef, which is the default function
+ used for godoc-at-point and matches the previous behaviour.
+
+ * Add new customizable variable godoc-and-godef-command, which allows
+ specifying the path to the godoc binary.
+
* Add the function godoc-gogetdoc, which provides godoc-at-point
functionality by using the third party tool gogetdoc.
diff --git a/go-mode.el b/go-mode.el
index f1b6a8a..929890d 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -262,11 +262,18 @@ mis-identifying them as gb projects."
:group 'go)
(defcustom godoc-command "go doc"
- "Choose between using `godoc' and `go doc' for M-x godoc."
- :type '(choice
- (const :tag "godoc" "godoc")
- (const :tag "go doc" "go doc"))
- :group 'godoc)
+ "Which executable to use for `godoc'. This can either be
+'godoc' or 'go doc', both as an absolute path or an executable in
+PATH."
+ :type 'string
+ :group 'go)
+
+(defcustom godoc-and-godef-command "godoc"
+ "Which executable to use for `godoc' in
+`godoc-and-godef-command'. Must be 'godoc' and not 'go doc' and
+can be an absolute path or an executable in PATH."
+ :type 'string
+ :group 'go)
(defcustom godoc-use-completing-read nil
"Provide auto-completion for godoc. Only really desirable when using `godoc'
instead of `go doc'."
@@ -303,11 +310,12 @@ Consider using godoc-gogetdoc instead for more accurate
results."
(first (car name-parts)))
(if (not (godef--successful-p file))
(message "%s" (godef--error file))
- (godoc (format "%s %s"
+ (go--godoc (format "%s %s"
(file-name-directory file)
(if (or (string= first "type") (string= first
"const"))
(cadr name-parts)
- (car name-parts))))))
+ (car name-parts)))
+ godoc-and-godef-command)))
(file-error (message "Could not run godef binary"))))
(defun godoc-gogetdoc (point)
@@ -1236,11 +1244,14 @@ you save any file, kind of defeating the point of
autoloading."
;;;###autoload
(defun godoc (query)
"Show Go documentation for QUERY, much like M-x man."
+ (go--godoc query godoc-command))
+
+(defun go--godoc (query command)
(interactive (list (godoc--read-query)))
(unless (string= query "")
(set-process-sentinel
(start-process-shell-command "godoc" (godoc--get-buffer query)
- (concat godoc-command " " query))
+ (concat command " " query))
'godoc--buffer-sentinel)
nil))
- [nongnu] elpa/go-mode 53f50f7 299/495: Make godoc command and completion configurable, (continued)
- [nongnu] elpa/go-mode 53f50f7 299/495: Make godoc command and completion configurable, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 1a0541c 312/495: Simplify go-packages-go-list by using process-lines, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 404f8ca 308/495: Improve README and NEWS entries for new goto commands, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode f12f2cc 319/495: Add support for gogetdoc, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7fec5b2 317/495: Move test Go files to testdata, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 648ad3d 311/495: Use null-device instead of /dev/null, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e035e60 309/495: Mention GOPATH detection in README, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 43da263 313/495: Simplify go-root-and-paths by using process-lines, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 95c74ba 324/495: Update URL to gogetdoc tool., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 228ded4 314/495: Use cons instead of append, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 205672f 322/495: Use separate godoc commands for godoc and godoc-at-point,
ELPA Syncer <=
- [nongnu] elpa/go-mode 737611e 329/495: Update URL to goimports, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode b65e408 334/495: go.tools/cmd/oracle: cosmetic tweaks to Emacs., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e76464a 331/495: go.tools/oracle: an oracle that answers questions about Go source code., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 8560557 354/495: cmd/guru: fix bug in mode map caused by bad merge, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode b36d2fd 352/495: cmd/guru: emacs: report an error when the guru command fails, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d41ebaf 341/495: go.tools/oracle: improvements to command set and performance., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 385153c 338/495: go.tools/oracle: new query 'referrers' returns all references to an identifier., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode f18b4eb 369/495: cmd/guru: support streaming plain and -json output, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 9a5284b 362/495: cmd/guru: emacs: update scope documentation, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4dfa1c4 350/495: cmd/guru: add support for loading modified files, ELPA Syncer, 2021/08/07