Got the imenu working as a menu mode

This commit is contained in:
Howard Abrams 2024-07-25 21:43:45 -07:00
parent c7ed6c03f7
commit 12d12bd3da

View file

@ -115,11 +115,12 @@ Ive often called =imenu= to easily jump to a function definition in a file (o
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun ha-imenu-setup () (defun ha-imenu-setup ()
"Sets up the imenu customization. Use in hooks." "Set up the imenu customization. Use in hooks."
(imenu-add-menubar-index) (ignore-errors
(setq-local imenu-auto-rescan t) (imenu-add-menubar-index)
(when (derived-mode-p 'prog-mode) (setq-local imenu-auto-rescan t)
(setq-local imenu-sort-function #'imenu--sort-by-name))) (when (derived-mode-p 'prog-mode)
(setq-local imenu-sort-function #'imenu--sort-by-name))))
(add-hook 'org-mode-hook 'ha-imenu-setup) (add-hook 'org-mode-hook 'ha-imenu-setup)
(add-hook 'markdown-mode-hook 'ha-imenu-setup) (add-hook 'markdown-mode-hook 'ha-imenu-setup)