summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2015-09-16 21:34:24 +0300
committerAlex Kost <alezost@gmail.com>2015-09-27 12:23:01 +0300
commit02c980f319f60ad97d215437ca29eff500e533d6 (patch)
treef972b9d3581af37d3eab94c2958ed3170fce01a3
parentf8251641dc2048ef46e2089a8f2ccb119fe1f1f7 (diff)
downloadgeiser-02c980f319f60ad97d215437ca29eff500e533d6.tar.gz
geiser-02c980f319f60ad97d215437ca29eff500e533d6.tar.bz2
Add 'geiser-syntax--simple-keywords'
Use this function instead of repeating the same code in each implementation.
-rw-r--r--elisp/geiser-syntax.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el
index 9557f5e..bc110d9 100644
--- a/elisp/geiser-syntax.el
+++ b/elisp/geiser-syntax.el
@@ -60,6 +60,12 @@
(2 font-lock-function-name-face nil t))
(,(rx "(" (group "when") eow) . 1)))
+(defun geiser-syntax--simple-keywords (keywords)
+ "Return `font-lock-keywords' to highlight scheme KEYWORDS.
+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)
(geiser-impl--define-caller geiser-syntax--impl-kws keywords ()