diff options
author | Kyle Meyer <kyle@kyleam.com> | 2016-01-21 01:58:21 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2016-01-21 01:59:09 -0500 |
commit | cfbf0675a02e47df401fbe5a20cf95c955cbbc1a (patch) | |
tree | 9de4184a9d61778e134d69fd1cdfa03d232336b1 | |
parent | fdc511572823f64ef3c1bffe25bd3a88787d5d6a (diff) | |
download | emacs.d-cfbf0675a02e47df401fbe5a20cf95c955cbbc1a.tar.gz |
Add use-package to imenu
-rw-r--r-- | init.el | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -1543,7 +1543,16 @@ (setq outline-regexp ";;;;* ") (setq outline-level #'km/elisp-outline-level)) - (add-hook 'emacs-lisp-mode-hook #'km/elisp-set-outline-vars)) + (add-hook 'emacs-lisp-mode-hook #'km/elisp-set-outline-vars) + + ;; Modified from usepackage's issue #80. + (defun km/imenu-add-use-package () + (when (string= (buffer-file-name (buffer-base-buffer)) + user-init-file) + (add-to-list + 'imenu-generic-expression + '("Packages" "^\\s-*(\\(use-package\\)\\s-+\\(\\(\\sw\\|\\s_\\)+\\)" 2)))) + (add-hook 'emacs-lisp-mode-hook #'km/imenu-add-use-package)) (use-package find-function :bind (("C-h ;" . find-function) |