summaryrefslogtreecommitdiff
path: root/elisp
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
commit0d3b1f8c0dcbb3a585a39bb60cc8ca6bd61d3df9 (patch)
tree33753c8dd3e81e50b7fe5898437c644b42b6f235 /elisp
parent2ea6d9d90e72e26e00ebe84785064f237dfaf0ee (diff)
downloadgeiser-guile-0d3b1f8c0dcbb3a585a39bb60cc8ca6bd61d3df9.tar.gz
geiser-guile-0d3b1f8c0dcbb3a585a39bb60cc8ca6bd61d3df9.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')
-rw-r--r--elisp/geiser-guile.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el
index a53395d..865c7fc 100644
--- a/elisp/geiser-guile.el
+++ b/elisp/geiser-guile.el
@@ -87,6 +87,11 @@ effect on new REPLs. For existing ones, use the command
(repeat :tag "Custom" symbol))
:group 'geiser-guile)
+(geiser-custom--defcustom geiser-guile-extra-keywords nil
+ "Extra keywords highlighted in Guile scheme buffers."
+ :type '(repeat string)
+ :group 'geiser-guile)
+
;;; REPL support:
@@ -207,6 +212,13 @@ This function uses `geiser-guile-init-file' if it exists."
(re-search-forward geiser-guile--guess-re nil t)))
+;;; Keywords
+(defun geiser-guile--keywords ()
+ (when geiser-guile-extra-keywords
+ `((,(format "[[(]%s\\>" (regexp-opt geiser-guile-extra-keywords 1))
+ . 1))))
+
+
;;; Compilation shell regexps
(defconst geiser-guile--path-rx "^In \\([^:\n ]+\\):\n")
@@ -284,7 +296,8 @@ it spawn a server thread."
(find-symbol-begin geiser-guile--symbol-begin)
(display-error geiser-guile--display-error)
(display-help)
- (check-buffer geiser-guile--guess))
+ (check-buffer geiser-guile--guess)
+ (keywords geiser-guile--keywords))
(geiser-impl--add-to-alist 'regexp "\\.scm$" 'guile nil)