summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2019-07-11 22:54:38 +0200
committerMartin Polden <mpolden@mpolden.no>2019-07-11 22:54:38 +0200
commitf6868dac674a8c2520027fcea8ca279e7d3a7b6e (patch)
tree9fda14ba31bf83f48b4c9c988d4ae19cb4fa3bf3
parent3d29929f068a01d586940e207b33cbd1e6c4f9ba (diff)
Remove imenu customization for go-mode
lsp-mode now provides a sane imenu.
-rw-r--r--lisp/init-go-mode.el30
1 files changed, 1 insertions, 29 deletions
diff --git a/lisp/init-go-mode.el b/lisp/init-go-mode.el
index 55a37d4..e278239 100644
--- a/lisp/init-go-mode.el
+++ b/lisp/init-go-mode.el
@@ -1,28 +1,3 @@
-(defun go-mode-create-imenu-index ()
- "Create and return an imenu index alist. Unlike the default
-alist created by go-mode, this method creates an alist where
-items follow a style that is consistent with other prog-modes."
- (let* ((patterns '(("type" "^type *\\([^ \t\n\r\f]*\\)" 1)))
- (type-index (imenu--generic-function patterns))
- (func-index))
- (save-excursion
- (goto-char (point-min))
- (while (re-search-forward go-func-meth-regexp (point-max) t)
- (let* ((var (match-string-no-properties 1))
- (func (match-string-no-properties 2))
- (name (if var
- (concat (substring var 0 -1) "." func)
- func))
- (beg (match-beginning 0))
- (marker (copy-marker beg))
- (item (cons name marker)))
- (setq func-index (cons item func-index)))))
- (nconc type-index (list (cons "func" func-index)))))
-
-(defun go-mode-create-flat-imenu-index ()
- "Return a flat imenu index alist. See `go-mode-create-imenu-index'."
- (apply 'nconc (mapcar 'cdr (go-mode-create-imenu-index))))
-
(use-package go-mode
:init
;; use goimports if available
@@ -39,9 +14,6 @@ items follow a style that is consistent with other prog-modes."
(add-hook 'go-mode-hook
(lambda ()
;; adjust fill-column
- (setq-local fill-column 120)
- ;; use flat imenu index
- (setq-local imenu-create-index-function
- #'go-mode-create-flat-imenu-index))))
+ (setq-local fill-column 120))))
(provide 'init-go-mode)