summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2023-03-22 18:13:05 -0700
committerSean Whitton <spwhitton@spwhitton.name>2023-03-22 18:13:24 -0700
commit88978c39ac6076ac912ba6d95b61d3c50f1d422a (patch)
treedc0672d38d2d8bdedcb9ac85734770a84fed3cc8
parentae1dc7585eab1eb9df35d150f8ab46f81cbf586a (diff)
downloaddotfiles-88978c39ac6076ac912ba6d95b61d3c50f1d422a.tar.gz
fix setting lisp-imenu-generic-expression on Emacs 28
-rw-r--r--.emacs.d/init.el39
1 files changed, 21 insertions, 18 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index eb8959f7..827fd8f8 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -4387,24 +4387,27 @@ mutt's review view, after exiting EDITOR."
;; because a basic expression to find custom defining forms will also find
;; everything that the default value finds, and indeed merge them into the top
;; level of the menu, anyway.
-(when (get 'lisp-mode-symbol 'rx-definition) ; for Emacs 28
- (setq lisp-imenu-generic-expression
- (rx-let ((spc (in blank ?\n))
- (sym (| word (syntax symbol))))
- `((nil ,(rx bol (0+ blank) ?\( (opt "spw/") (opt "cl-") "def"
- (| (1+ word)
- (: "ine-"
- ;; Require symbol constituents next, but we don't
- ;; want to index calls to `define-key' ...
- ;; There is also `define-abbrev'.
- (| (: (in "a-jl-z0-9-") (0+ sym))
- (: ?k (opt (in "a-df-z0-9-") (0+ sym)))
- (: "ke" (opt (in "a-xz0-9-") (0+ sym)))
- (: "key" (1+ sym)))))
- (1+ spc) (opt ?') (group lisp-mode-symbol)
- ;; Exclude declarations like (defvar FOO) in Elisp.
- (1+ spc) (not ?\)))
- 1)))))
+(setq lisp-imenu-generic-expression
+ (rx-let ((spc (in blank ?\n))
+ (sym (| word (syntax symbol)))
+ ;; For Emacs 28.
+ (lisp-mode-symbol (+ (| (syntax word)
+ (syntax symbol)
+ (: "\\" nonl)))))
+ `((nil ,(rx bol (0+ blank) ?\( (opt "spw/") (opt "cl-") "def"
+ (| (1+ word)
+ (: "ine-"
+ ;; Require symbol constituents next, but we don't
+ ;; want to index calls to `define-key' ...
+ ;; There is also `define-abbrev'.
+ (| (: (in "a-jl-z0-9-") (0+ sym))
+ (: ?k (opt (in "a-df-z0-9-") (0+ sym)))
+ (: "ke" (opt (in "a-xz0-9-") (0+ sym)))
+ (: "key" (1+ sym)))))
+ (1+ spc) (opt ?') (group lisp-mode-symbol)
+ ;; Exclude declarations like (defvar FOO) in Elisp.
+ (1+ spc) (not ?\)))
+ 1))))
(defun spw/consfig-indentation-hints ()
(put 'spwcrontab 'common-lisp-indent-function '1)