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
(defun ha-imenu-setup ()
"Sets up the imenu customization. Use in hooks."
(imenu-add-menubar-index)
(setq-local imenu-auto-rescan t)
(when (derived-mode-p 'prog-mode)
(setq-local imenu-sort-function #'imenu--sort-by-name)))
"Set up the imenu customization. Use in hooks."
(ignore-errors
(imenu-add-menubar-index)
(setq-local imenu-auto-rescan t)
(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 'markdown-mode-hook 'ha-imenu-setup)