summaryrefslogtreecommitdiff
path: root/elisp/geiser-syntax.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-27 00:54:59 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-27 00:54:59 +0100
commitb39fd77d8899bc7ff6608645afc9e2eb0eb0d33c (patch)
tree2228ff22afcc5423239572bbcdf186d31e11714a /elisp/geiser-syntax.el
parent96610db57a61d5380eeeb3b4780846c39fb79422 (diff)
downloadgeiser-chez-b39fd77d8899bc7ff6608645afc9e2eb0eb0d33c.tar.gz
geiser-chez-b39fd77d8899bc7ff6608645afc9e2eb0eb0d33c.tar.bz2
No more interning in the scheme reader
We avoid using elisp's read for symbols, reading uninterned ones instead. And then, we cannot use symbols as keys in responses from scheme: we're using strings instead.
Diffstat (limited to 'elisp/geiser-syntax.el')
-rw-r--r--elisp/geiser-syntax.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el
index ae1c3dd..17e0999 100644
--- a/elisp/geiser-syntax.el
+++ b/elisp/geiser-syntax.el
@@ -122,6 +122,11 @@ implementation-specific entries for font-lock-keywords.")
(defsubst geiser-syntax--read/elisp ()
(ignore-errors (read (current-buffer))))
+(defun geiser-syntax--read/symbol ()
+ (with-syntax-table scheme-mode-syntax-table
+ (when (re-search-forward "\\(\\sw\\|\\s_\\)+" nil t)
+ (make-symbol (match-string 0)))))
+
(defun geiser-syntax--read/matching (open close)
(let ((count 1)
(p (1+ (point))))
@@ -160,7 +165,7 @@ implementation-specific entries for font-lock-keywords.")
(?\( (geiser-syntax--read/token 'vectorb))
(?\< (geiser-syntax--read/unprintable))
((?' ?` ?,) (geiser-syntax--read/next-token))
- (t (let ((tok (geiser-syntax--read/elisp)))
+ (t (let ((tok (geiser-syntax--read/symbol)))
(if tok (cons 'atom (intern (format "#%s" tok)))
(geiser-syntax--read/next-token))))))
(?\' (geiser-syntax--read/token '(quote . quote)))
@@ -171,7 +176,7 @@ implementation-specific entries for font-lock-keywords.")
`(splice . ,backquote-splice-symbol))
`(unquote . ,backquote-unquote-symbol)))
(?\" (cons 'string (geiser-syntax--read/elisp)))
- (t (cons 'atom (geiser-syntax--read/elisp))))))
+ (t (cons 'atom (geiser-syntax--read/symbol))))))
(defsubst geiser-syntax--read/match (&rest tks)
(let ((token (geiser-syntax--read/next-token)))