-
Notifications
You must be signed in to change notification settings - Fork 12
/
smart-jump-go-mode.el
51 lines (41 loc) · 1.92 KB
/
smart-jump-go-mode.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
;;; smart-jump-go-mode.el --- Register `go-mode' for `smart-jump'. -*- lexical-binding: t -*-
;; Copyright (C) 2017 James Nguyen, Terje Larsen
;; Author: James Nguyen <[email protected]>, Terje Larsen <[email protected]>
;; Maintainer: James Nguyen <[email protected]>, Terje Larsen <[email protected]>
;; URL: https://github.com/jojojames/smart-jump
;; Version: 0.0.1
;; Package-Requires: ((emacs "25.1"))
;; Keywords: emacs, tools
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; Register `go-mode' for `smart-jump'.
;;; This requires the `go-guru' package and the tool `guru' installed and
;;; available on your $PATH.
;;; Code:
(require 'smart-jump)
(require 'go-guru nil t)
(defun smart-jump-go-mode-go-guru-available-p ()
"Return whether or not `go-guru' is available."
(fboundp 'go-guru-definition))
;;;###autoload
(defun smart-jump-go-mode-register ()
"Register `go-mode' for `smart-jump'."
(smart-jump-register :modes 'go-mode
:jump-fn 'go-guru-definition
:refs-fn 'go-guru-referrers
:order 1
:should-jump #'smart-jump-go-mode-go-guru-available-p)
(smart-jump-register :modes 'go-mode
:jump-fn 'godef-jump
:order 2))
(provide 'smart-jump-go-mode)
;;; smart-jump-go-mode.el ends here