summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRudolf Adamkovič <salutis@me.com>2022-12-24 01:00:32 +0100
committerEli Zaretskii <eliz@gnu.org>2022-12-27 15:57:45 +0200
commit1fe4b98b4d5e0fe3d9964bd1789d3ee5be61dd2a (patch)
tree9225fc85efb8c2960abb71cdfcc34aaf68908f7f /lisp
parent2347f37f677cc4c3acbc84c424c08dff369e9047 (diff)
downloademacs-1fe4b98b4d5e0fe3d9964bd1789d3ee5be61dd2a.tar.gz
emacs-1fe4b98b4d5e0fe3d9964bd1789d3ee5be61dd2a.tar.bz2
emacs-1fe4b98b4d5e0fe3d9964bd1789d3ee5be61dd2a.zip
Improve support for Scheme R6RS and R7RS libraries (bug#54704)
* etc/NEWS (Scheme mode): Document improved file-type auto-detection and Imenu support for R6RS and R7RS Scheme libraries. * lisp/files.el (auto-mode-alist): Associate the '.sls' (R6RS Scheme Library Source) and '.sld' (R7RS Scheme Library Definition) file name extensions with the Scheme mode. * lisp/progmodes/scheme.el (scheme-imenu-generic-expression): Make Imenu recognize the members nested (and so indented) inside of 'library' (R6RS) or 'define-library' (R7RS) forms.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/files.el2
-rw-r--r--lisp/progmodes/scheme.el20
2 files changed, 14 insertions, 8 deletions
diff --git a/lisp/files.el b/lisp/files.el
index f352d3a9a7e..522e4fbf935 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2850,7 +2850,7 @@ since only a single case-insensitive search through the alist is made."
("\\.emacs-places\\'" . lisp-data-mode)
("\\.el\\'" . emacs-lisp-mode)
("Project\\.ede\\'" . emacs-lisp-mode)
- ("\\.\\(scm\\|stk\\|ss\\|sch\\)\\'" . scheme-mode)
+ ("\\.\\(scm\\|sls\\|sld\\|stk\\|ss\\|sch\\)\\'" . scheme-mode)
("\\.l\\'" . lisp-mode)
("\\.li?sp\\'" . lisp-mode)
("\\.[fF]\\'" . fortran-mode)
diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el
index 8454f24356a..f45d7992524 100644
--- a/lisp/progmodes/scheme.el
+++ b/lisp/progmodes/scheme.el
@@ -115,7 +115,8 @@
(defvar scheme-imenu-generic-expression
`((nil
- ,(rx bol "(define"
+ ,(rx bol (zero-or-more space)
+ "(define"
(zero-or-one "*")
(zero-or-one "-public")
(one-or-more space)
@@ -123,36 +124,41 @@
(group (one-or-more (or word (syntax symbol)))))
1)
("Methods"
- ,(rx bol "(define-"
+ ,(rx bol (zero-or-more space)
+ "(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"
+ ,(rx bol (zero-or-more space)
+ "(define-class"
(one-or-more space)
(zero-or-one "(")
(group (one-or-more (or word (syntax symbol)))))
1)
("Records"
- ,(rx bol "(define-record-type"
+ ,(rx bol (zero-or-more space)
+ "(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"
+ ,(rx bol (zero-or-more space)
+ "(define-condition-type"
(one-or-more space)
(group (one-or-more (or word (syntax symbol)))))
1)
("Modules"
- ,(rx bol "(define-module"
+ ,(rx bol (zero-or-more space)
+ "(define-module"
(one-or-more space)
(group "(" (one-or-more any) ")"))
1)
("Macros"
- ,(rx bol "("
+ ,(rx bol (zero-or-more space) "("
(or (and "defmacro"
(zero-or-one "*")
(zero-or-one "-public"))