branch: elpa/go-mode
commit 46448eaadba92805350b553329967ae6b44f7c84
Author: Lowe Thiderman <[email protected]>
Commit: Lowe Thiderman <[email protected]>
Collect all the define-key statements at the bottom
---
go-mode.el | 26 ++++++++++----------------
1 file changed, 10 insertions(+), 16 deletions(-)
diff --git a/go-mode.el b/go-mode.el
index 4ae3c40..bbf6ef1 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -1568,9 +1568,6 @@ for."
(if (not (eq cur-buffer (current-buffer)))
(display-buffer (current-buffer)
`(,go-coverage-display-buffer-func))))))
-(define-prefix-command 'go-goto-map)
-(define-key go-mode-map (kbd "C-c C-g") 'go-goto-map)
-
(defun go-goto-function ()
"Go to the function defintion above point.
@@ -1614,8 +1611,6 @@ If the function is anonymous, place point on the 'func'
keyword."
(when (looking-at "Test")
(forward-char 4)))))
-(define-key go-goto-map (kbd "f") 'go-goto-function-name)
-
(defun go-goto-arguments ()
"Go to the return value declaration of the current function."
(interactive)
@@ -1623,8 +1618,6 @@ If the function is anonymous, place point on the 'func'
keyword."
(forward-word 1)
(forward-char 1))
-(define-key go-goto-map (kbd "a") 'go-goto-arguments)
-
(defun go-goto-return-value ()
"Go to the return value declaration of the current function.
@@ -1645,11 +1638,6 @@ If there is none, make space for one to be added."
(insert " ")
(backward-char 1)))
-(define-key go-goto-map (kbd "r") 'go-goto-return-value)
-
-;; Since this is already defined, just add the key to it.
-(define-key go-goto-map (kbd "i") 'go-goto-imports)
-
(defun go-goto-type-signature ()
"Go to the type signature of the current function.
@@ -1662,8 +1650,6 @@ If there is none, add parenthesis to add one."
(insert "() ")))
(forward-char 1))
-(define-key go-goto-map (kbd "t") 'go-goto-type-signature)
-
(defun go-goto-docstring ()
"Go to the top of the docstring of the current function.
@@ -1683,14 +1669,22 @@ If there is none, add one."
(newline)
(insert (format "// %s " (go--get-function-name)))))
-(define-key go-goto-map (kbd "d") 'go-goto-docstring)
-
(defun go--get-function-name ()
"Return the current function name as a string"
(save-excursion
(go-goto-function-name)
(symbol-name (symbol-at-point))))
+(define-prefix-command 'go-goto-map)
+(define-key go-mode-map (kbd "C-c C-g") 'go-goto-map)
+
+(define-key go-goto-map (kbd "a") 'go-goto-arguments)
+(define-key go-goto-map (kbd "d") 'go-goto-docstring)
+(define-key go-goto-map (kbd "f") 'go-goto-function-name)
+(define-key go-goto-map (kbd "i") 'go-goto-imports)
+(define-key go-goto-map (kbd "r") 'go-goto-return-value)
+(define-key go-goto-map (kbd "t") 'go-goto-type-signature)
+
(provide 'go-mode)
;;; go-mode.el ends here