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
commit1723f5365251519b7ef80671fa213f7d97293e29 (patch)
tree3721e27328482df15d38a4a95f6e4c0a466095e0 /elisp/geiser-syntax.el
parentf5a22dec2bee961d852e242b8eed561c178a801f (diff)
downloadgeiser-1723f5365251519b7ef80671fa213f7d97293e29.tar.gz
geiser-1723f5365251519b7ef80671fa213f7d97293e29.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)))