imalison:make-imenu-index-flat, flatten python imenu index

This commit is contained in:
Ivan Malison 2015-08-07 17:00:51 -07:00
parent 60a5ba6fbe
commit 96142d2e89

View File

@ -211,6 +211,13 @@
(cdr-is-index (imalison:imenu-prefix-flattened index)) (cdr-is-index (imalison:imenu-prefix-flattened index))
(t (list index))))) (t (list index)))))
(defun imalison:make-imenu-index-flat ()
(let ((original-imenu-function imenu-create-index-function))
(setq imenu-create-index-function
(lambda ()
(imalison:flatten-imenu-index
(funcall original-imenu-function))))))
(defmacro defvar-if-non-existent (name value) (defmacro defvar-if-non-existent (name value)
(unless (boundp name) (unless (boundp name)
`(defvar ,name ,value))) `(defvar ,name ,value)))
@ -1640,6 +1647,7 @@ window is active in the perspective."
(if use-python-tabs (python-tabs)) (if use-python-tabs (python-tabs))
(subword-mode t) (subword-mode t)
(elpy-mode) (elpy-mode)
(imalison:make-imenu-index-flat)
;; Will this work with elpy. Seems like elpy has its own ;; Will this work with elpy. Seems like elpy has its own
;; mechanism for handling this ;; mechanism for handling this
;; (add-virtual-envs-to-jedi-server) ;; (add-virtual-envs-to-jedi-server)