summaryrefslogtreecommitdiff
path: root/elisp/geiser-syntax.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-14 20:19:10 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-14 20:43:26 +0100
commita07fcbb866082f533acbe89e028d05d4a3904b2a (patch)
treefa74a78d0a24c391b62f3bcd237bdebb0f4550f5 /elisp/geiser-syntax.el
parent39d79b5b02bfa183715996b15e7b3ca2b87973b9 (diff)
downloadgeiser-chez-a07fcbb866082f533acbe89e028d05d4a3904b2a.tar.gz
geiser-chez-a07fcbb866082f533acbe89e028d05d4a3904b2a.tar.bz2
Support for implementation-specific font lock keywords
Spinning up from correct fontification of [else in this brave Racket world. I'm keeping the list of extra keywords lean and mean, but making it customizable in both Racket and Guile.
Diffstat (limited to 'elisp/geiser-syntax.el')
-rw-r--r--elisp/geiser-syntax.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el
index f134ea4..40f2def 100644
--- a/elisp/geiser-syntax.el
+++ b/elisp/geiser-syntax.el
@@ -85,6 +85,22 @@
(with-syntax 1))
+;;; Extra syntax keywords
+(defconst geiser-syntax--keywords
+ '(("\\[\\(else\\)\\>" . 1)
+ ("(\\(parameterize\\)\\>" . 1)))
+
+(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,
+implementation-specific entries for font-lock-keywords.")
+
+(defun geiser-syntax--add-kws ()
+ (let ((kw (geiser-syntax--impl-kws geiser-impl--implementation)))
+ (when kw (font-lock-add-keywords nil kw))))
+
+
;;; A simple scheme reader
(defvar geiser-syntax--read/buffer-limit nil)