summaryrefslogtreecommitdiff
path: root/elisp/geiser-syntax.el
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2015-09-24 21:19:25 +0300
committerAlex Kost <alezost@gmail.com>2015-09-27 12:23:01 +0300
commit0e2433c7f681a46f60b9c483a82bc39ec390a18d (patch)
treef0ecadedb44962176eb198d1e6684633ee1a9459 /elisp/geiser-syntax.el
parent02c980f319f60ad97d215437ca29eff500e533d6 (diff)
downloadgeiser-0e2433c7f681a46f60b9c483a82bc39ec390a18d.tar.gz
geiser-0e2433c7f681a46f60b9c483a82bc39ec390a18d.tar.bz2
Add general font-lock keywords for all implementations
Move general RNRS/SRFI keywords from "geiser-chicken" to "geiser-syntax".
Diffstat (limited to 'elisp/geiser-syntax.el')
-rw-r--r--elisp/geiser-syntax.el43
1 files changed, 34 insertions, 9 deletions
diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el
index bc110d9..091a8b4 100644
--- a/elisp/geiser-syntax.el
+++ b/elisp/geiser-syntax.el
@@ -51,14 +51,30 @@
;;; Extra syntax keywords
-(defconst geiser-syntax--keywords
- `(("\\[\\(else\\)\\>" . 1)
- ("(\\(parameterize\\)\\>" . 1)
- (,(rx "(" (group "define-syntax-rule") eow (* space)
- (? "(") (? (group (1+ word))))
- (1 font-lock-keyword-face)
- (2 font-lock-function-name-face nil t))
- (,(rx "(" (group "when") eow) . 1)))
+
+(defconst geiser-syntax--builtin-keywords
+ '("and-let*"
+ "cut"
+ "cute"
+ "define-condition-type"
+ "define-immutable-record-type"
+ "define-record-type"
+ "define-values"
+ "letrec*"
+ "match"
+ "match-lambda"
+ "match-lambda*"
+ "match-let"
+ "match-let*"
+ "match-letrec"
+ "parameterize"
+ "receive"
+ "require-extension"
+ "set!"
+ "unless"
+ "when"
+ "with-input-from-file"
+ "with-output-to-file"))
(defun geiser-syntax--simple-keywords (keywords)
"Return `font-lock-keywords' to highlight scheme KEYWORDS.
@@ -66,7 +82,16 @@ KEYWORDS should be a list of strings."
(when keywords
`((,(format "[[(]%s\\>" (regexp-opt keywords 1)) . 1))))
-(font-lock-add-keywords 'scheme-mode geiser-syntax--keywords)
+(defun geiser-syntax--keywords ()
+ (append
+ (geiser-syntax--simple-keywords geiser-syntax--builtin-keywords)
+ `(("\\[\\(else\\)\\>" . 1)
+ (,(rx "(" (group "define-syntax-rule") eow (* space)
+ (? "(") (? (group (1+ word))))
+ (1 font-lock-keyword-face)
+ (2 font-lock-function-name-face nil t)))))
+
+(font-lock-add-keywords 'scheme-mode (geiser-syntax--keywords))
(geiser-impl--define-caller geiser-syntax--impl-kws keywords ()
"A variable (or thunk returning a value) giving additional,