From b39fd77d8899bc7ff6608645afc9e2eb0eb0d33c Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sat, 27 Nov 2010 00:54:59 +0100 Subject: 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. --- elisp/geiser-syntax.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'elisp/geiser-syntax.el') 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))) -- cgit v1.2.3