diff options
author | Alex Kost <alezost@gmail.com> | 2022-01-23 14:12:34 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-01-23 14:12:34 +0100 |
commit | 0e833a1d5f93d3028ef1ea133174636b46bc64f1 (patch) | |
tree | ca15b6ae6b792bafe82f6a3bffacba345039d557 /lisp/progmodes/scheme.el | |
parent | 1bcbca3750d9e8c47bee7ac893b885ade584d783 (diff) | |
download | emacs-0e833a1d5f93d3028ef1ea133174636b46bc64f1.tar.gz emacs-0e833a1d5f93d3028ef1ea133174636b46bc64f1.tar.bz2 emacs-0e833a1d5f93d3028ef1ea133174636b46bc64f1.zip |
Improve scheme-imenu-generic-expression
* lisp/progmodes/scheme.el (scheme-imenu-generic-expression):
Improve so that we match `define-public' etc (bug#33117).
Diffstat (limited to 'lisp/progmodes/scheme.el')
-rw-r--r-- | lisp/progmodes/scheme.el | 53 |
1 files changed, 47 insertions, 6 deletions
diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el index 6f47f645e02..592e2d50570 100644 --- a/lisp/progmodes/scheme.el +++ b/lisp/progmodes/scheme.el @@ -115,12 +115,53 @@ (define-abbrev-table 'scheme-mode-abbrev-table ()) (defvar scheme-imenu-generic-expression - '((nil - "^(define\\(?:-\\(?:generic\\(?:-procedure\\)?\\|method\\)\\)?\\s-+(?\\(\\sw+\\)" 1) - ("Types" - "^(define-class\\s-+(?\\(\\sw+\\)" 1) - ("Macros" - "^(\\(defmacro\\|define-macro\\|define-syntax\\)\\s-+(?\\(\\sw+\\)" 2)) + `((nil + ,(rx bol "(define" + (zero-or-one "*") + (zero-or-one "-public") + (one-or-more space) + (zero-or-one "(") + (group (one-or-more (or word (syntax symbol))))) + 1) + ("Methods" + ,(rx bol "(define-" + (or "generic" "method" "accessor") + (one-or-more space) + (zero-or-one "(") + (group (one-or-more (or word (syntax symbol))))) + 1) + ("Classes" + ,(rx bol "(define-class" + (one-or-more space) + (zero-or-one "(") + (group (one-or-more (or word (syntax symbol))))) + 1) + ("Records" + ,(rx bol "(define-record-type" + (zero-or-one "*") + (one-or-more space) + (group (one-or-more (or word (syntax symbol))))) + 1) + ("Conditions" + ,(rx bol "(define-condition-type" + (one-or-more space) + (group (one-or-more (or word (syntax symbol))))) + 1) + ("Modules" + ,(rx bol "(define-module" + (one-or-more space) + (group "(" (one-or-more any) ")")) + 1) + ("Macros" + ,(rx bol "(" + (or (and "defmacro" + (zero-or-one "*") + (zero-or-one "-public")) + "define-macro" "define-syntax" "define-syntax-rule") + (one-or-more space) + (zero-or-one "(") + (group (one-or-more (or word (syntax symbol))))) + 1)) "Imenu generic expression for Scheme mode. See `imenu-generic-expression'.") (defun scheme-mode-variables () |