Commit a969f3c2 authored by Dominik Honnef's avatar Dominik Honnef Committed by Alan Donovan

misc/emacs: Add tab completion for godoc command, completing from known installed packages

R=golang-dev, adonovan, bradfitz, cw, patrick.allen.higgins, sameer, ugorji
CC=golang-dev
https://golang.org/cl/7373051
parent 13075ed4
......@@ -35,6 +35,7 @@
(defconst go-type-name-regexp (concat "\\(?:[*(]\\)*\\(?:" go-identifier-regexp "\\.\\)?\\(" go-identifier-regexp "\\)"))
(defvar go-dangling-cache)
(defvar go-godoc-history nil)
(defgroup go nil
"Major mode for editing Go code"
......@@ -476,10 +477,10 @@ you save any file, kind of defeating the point of autoloading."
(symbol (if bounds
(buffer-substring-no-properties (car bounds)
(cdr bounds)))))
(read-string (if symbol
(format "godoc (default %s): " symbol)
"godoc: ")
nil nil symbol)))
(completing-read (if symbol
(format "godoc (default %s): " symbol)
"godoc: ")
(go-packages) nil nil nil 'go-godoc-history symbol)))
(defun godoc--get-buffer (query)
"Get an empty buffer for a godoc query."
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment