1
0
mirror of https://github.com/golang/go synced 2024-11-22 09:54:40 -07:00

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
This commit is contained in:
Dominik Honnef 2013-03-04 15:31:57 -05:00 committed by Alan Donovan
parent 13075ed416
commit a969f3c247

View File

@ -35,6 +35,7 @@
(defconst go-type-name-regexp (concat "\\(?:[*(]\\)*\\(?:" go-identifier-regexp "\\.\\)?\\(" go-identifier-regexp "\\)")) (defconst go-type-name-regexp (concat "\\(?:[*(]\\)*\\(?:" go-identifier-regexp "\\.\\)?\\(" go-identifier-regexp "\\)"))
(defvar go-dangling-cache) (defvar go-dangling-cache)
(defvar go-godoc-history nil)
(defgroup go nil (defgroup go nil
"Major mode for editing Go code" "Major mode for editing Go code"
@ -476,10 +477,10 @@ you save any file, kind of defeating the point of autoloading."
(symbol (if bounds (symbol (if bounds
(buffer-substring-no-properties (car bounds) (buffer-substring-no-properties (car bounds)
(cdr bounds))))) (cdr bounds)))))
(read-string (if symbol (completing-read (if symbol
(format "godoc (default %s): " symbol) (format "godoc (default %s): " symbol)
"godoc: ") "godoc: ")
nil nil symbol))) (go-packages) nil nil nil 'go-godoc-history symbol)))
(defun godoc--get-buffer (query) (defun godoc--get-buffer (query)
"Get an empty buffer for a godoc query." "Get an empty buffer for a godoc query."