summaryrefslogtreecommitdiff
path: root/elisp/geiser-racket.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-racket.el
parent39d79b5b02bfa183715996b15e7b3ca2b87973b9 (diff)
downloadgeiser-guile-a07fcbb866082f533acbe89e028d05d4a3904b2a.tar.gz
geiser-guile-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-racket.el')
-rw-r--r--elisp/geiser-racket.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/elisp/geiser-racket.el b/elisp/geiser-racket.el
index b348732..ac2e1f6 100644
--- a/elisp/geiser-racket.el
+++ b/elisp/geiser-racket.el
@@ -56,6 +56,11 @@ This executable is used by `run-gracket', and, if
:type 'boolean
:group 'geiser-racket)
+(geiser-custom--defcustom geiser-racket-extra-keywords
+ '("define-syntax-rule" "unless" "when" "with-handlers")
+ "Extra keywords highlighted in Racket buffers."
+ :type '(repeat string)
+ :group 'geiser-racket)
;;; REPL support:
@@ -223,6 +228,13 @@ This function uses `geiser-racket-init-file' if it exists."
(geiser-racket--explicit-module)))
+;;; Keywords
+(defun geiser-racket--keywords ()
+ (when geiser-racket-extra-keywords
+ `((,(format "[[(]%s\\>" (regexp-opt geiser-racket-extra-keywords 1))
+ . 1))))
+
+
;;; Remote REPLs
(defun connect-to-racket ()
@@ -251,6 +263,7 @@ using start-geiser, a procedure in the geiser/server module."
(display-error geiser-racket--display-error)
(display-help geiser-racket--external-help)
(check-buffer geiser-racket--guess)
+ (keywords geiser-racket--keywords)
(binding-forms geiser-racket--binding-forms)
(binding-forms* geiser-racket--binding-forms*))