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:
Henrik Lissner 2019-06-16 14:36:10 +02:00
parent 47739698a8
commit 39faabab6a
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -108,7 +108,7 @@ if it's callable, `apropos' otherwise."
(defun +emacs-lisp|extend-imenu ()
"Improve imenu support in `emacs-lisp-mode', including recognition for Doom's API."
(setq imenu-generic-expression
`(("Section" "^[ \t]*;;;;* \\(\\_<[^\n]+\\_>\\)" 1)
`(("Section" "^[ \t]*;;;;*[ \t]+\\([^\n]+\\)" 1)
("Evil commands" "^\\s-*(evil-define-\\(?:command\\|operator\\|motion\\) +\\(\\_<[^ ()\n]+\\_>\\)" 1)
("Unit tests" "^\\s-*(\\(?:ert-deftest\\|describe\\) +\"\\([^\")]+\\)\"" 1)
("Package" "^\\s-*(\\(?:;;;###package\\|def-package!\\|package!\\|use-package\\|after!\\) +\\(\\_<[^ ()\n]+\\_>\\)" 1)