mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
lang/emacs-lisp: fix imenu regexp for sections
Otherwise, section labels with non-symbol characters would be excluded from imenu's results.
This commit is contained in:
@ -108,7 +108,7 @@ if it's callable, `apropos' otherwise."
|
|||||||
(defun +emacs-lisp|extend-imenu ()
|
(defun +emacs-lisp|extend-imenu ()
|
||||||
"Improve imenu support in `emacs-lisp-mode', including recognition for Doom's API."
|
"Improve imenu support in `emacs-lisp-mode', including recognition for Doom's API."
|
||||||
(setq imenu-generic-expression
|
(setq imenu-generic-expression
|
||||||
`(("Section" "^[ \t]*;;;;* \\(\\_<[^\n]+\\_>\\)" 1)
|
`(("Section" "^[ \t]*;;;;*[ \t]+\\([^\n]+\\)" 1)
|
||||||
("Evil commands" "^\\s-*(evil-define-\\(?:command\\|operator\\|motion\\) +\\(\\_<[^ ()\n]+\\_>\\)" 1)
|
("Evil commands" "^\\s-*(evil-define-\\(?:command\\|operator\\|motion\\) +\\(\\_<[^ ()\n]+\\_>\\)" 1)
|
||||||
("Unit tests" "^\\s-*(\\(?:ert-deftest\\|describe\\) +\"\\([^\")]+\\)\"" 1)
|
("Unit tests" "^\\s-*(\\(?:ert-deftest\\|describe\\) +\"\\([^\")]+\\)\"" 1)
|
||||||
("Package" "^\\s-*(\\(?:;;;###package\\|def-package!\\|package!\\|use-package\\|after!\\) +\\(\\_<[^ ()\n]+\\_>\\)" 1)
|
("Package" "^\\s-*(\\(?:;;;###package\\|def-package!\\|package!\\|use-package\\|after!\\) +\\(\\_<[^ ()\n]+\\_>\\)" 1)
|
||||||
|
Reference in New Issue
Block a user