[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode 53f50f7 299/495: Make godoc command and completion
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode 53f50f7 299/495: Make godoc command and completion configurable |
Date: |
Sat, 7 Aug 2021 09:05:35 -0400 (EDT) |
branch: elpa/go-mode
commit 53f50f7bf1113e777e6844fe5d401feb8fc1210e
Author: Dominik Honnef <dominik@honnef.co>
Commit: Dominik Honnef <dominik@honnef.co>
Make godoc command and completion configurable
Introduce godoc-command that allows choosing between godoc and godoc.
Introduce godoc-use-completing-read that allows turning on or off the
use of completing-read for import paths in godoc.
Default to go doc and no completion, which differs from the old enforced
combination of godoc and completion. This is done because go doc is
generally the more useful tool.
Closes gh-101
---
NEWS | 9 +++++++++
go-mode.el | 31 +++++++++++++++++++++++++------
2 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/NEWS b/NEWS
index 50e24dc..339b0a9 100644
--- a/NEWS
+++ b/NEWS
@@ -38,6 +38,15 @@ go-mode-1.4.0 (???)
could be used from inside a projectile-switch-project-hook,
directory variables or some other way of invoking per-project code.
+ * Add 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.
+
+ * Add variable godoc-use-completing-read, which allows turning on or
+ off the completion of import paths in godoc. This is only really
+ useful when using godoc instead of go doc, and thus defaults to
+ off.
+
go-mode-1.3.1 (2015-07-03)
* The 1.3.0 release forgot to update the version in the package
diff --git a/go-mode.el b/go-mode.el
index f763562..7124edb 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -169,6 +169,10 @@ won't."
"Options specific to `cover`."
:group 'go)
+(defgroup godoc nil
+ "Options specific to `godoc'."
+ :group 'go)
+
(defcustom go-fontify-function-calls t
"Fontify function and method calls if this is non-nil."
:type 'boolean
@@ -254,6 +258,18 @@ mis-identifying them as gb projects."
:type '(repeat function)
: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)
+
+(defcustom godoc-use-completing-read nil
+ "Provide auto-completion for godoc. Only really desirable when using `godoc'
instead of `go doc'."
+ :type 'boolean
+ :group 'godoc)
+
(defun go--kill-new-message (url)
"Make URL the latest kill and print a message."
(kill-new url)
@@ -1116,11 +1132,14 @@ you save any file, kind of defeating the point of
autoloading."
(let* ((bounds (bounds-of-thing-at-point 'symbol))
(symbol (if bounds
(buffer-substring-no-properties (car bounds)
- (cdr bounds)))))
- (completing-read (if symbol
- (format "godoc (default %s): " symbol)
- "godoc: ")
- (go--old-completion-list-style (go-packages)) nil nil nil
'go-godoc-history symbol)))
+ (cdr bounds))))
+ (prompt (if symbol
+ (format "godoc (default %s): " symbol)
+ "godoc: ")))
+ (if godoc-use-completing-read
+ (completing-read prompt
+ (go--old-completion-list-style (go-packages)) nil nil
nil 'go-godoc-history symbol)
+ (read-from-minibuffer prompt symbol nil nil 'go-godoc-history))))
(defun godoc--get-buffer (query)
"Get an empty buffer for a godoc query."
@@ -1153,7 +1172,7 @@ you save any file, kind of defeating the point of
autoloading."
(unless (string= query "")
(set-process-sentinel
(start-process-shell-command "godoc" (godoc--get-buffer query)
- (concat "godoc " query))
+ (concat godoc-command " " query))
'godoc--buffer-sentinel)
nil))
- [nongnu] elpa/go-mode f44854b 278/495: More idiomatic docstrings, (continued)
- [nongnu] elpa/go-mode f44854b 278/495: More idiomatic docstrings, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 9424ab3 283/495: Map C-g f to goto-function and C-g n to goto-function-name, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode abc56d4 286/495: Rename go-goto-return-value to go-goto-return-values, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e4cd631 288/495: Update AUTHORS, automate process, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 63e67b1 290/495: go-goto-docstring: fix insertion of function name, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7c5e9ad 303/495: Avoid warning because of font-lock-syntactic-keywords, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode bdf353a 304/495: Use cl-lib instead of cl, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 82ebf74 302/495: Don't make ":", ", " or "=" electric, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode a49cdb8 305/495: Evaluate (featurep 'xemacs) at compile time, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3200a9f 301/495: Support electric-indent-mode, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 53f50f7 299/495: Make godoc command and completion configurable,
ELPA Syncer <=
- [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, 2021/08/07