Got the imenu working as a menu mode
This commit is contained in:
		
							parent
							
								
									c7ed6c03f7
								
							
						
					
					
						commit
						12d12bd3da
					
				
					 1 changed files with 6 additions and 5 deletions
				
			
		| 
						 | 
					@ -115,11 +115,12 @@ I’ve 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)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue