From 95af5d35139f8d8825dcfa2381a5bc16d46e0043 Mon Sep 17 00:00:00 2001
From: Jose Antonio Ortega Ruiz <jao@gnu.org>
Date: Sun, 2 Jan 2011 21:03:00 +0100
Subject: More robust symbol reading (instead of specializing for quack)

Let's use the scheme reader instead of half-assed regular expressions
and special-casing.
---
 elisp/geiser-syntax.el | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el
index cabc8a6..9f4da86 100644
--- a/elisp/geiser-syntax.el
+++ b/elisp/geiser-syntax.el
@@ -169,7 +169,7 @@ implementation-specific entries for font-lock-keywords.")
              (t (let ((tok (geiser-syntax--read/symbol)))
                   (cond ((equal (symbol-name tok) "t") '(boolean . :t))
                         ((equal (symbol-name tok) "f") '(boolean . :f))
-                        (tok (cons 'atom (make-symbol (format "#%s" tok))))
+                        (tok (cons 'atom tok))
                         (t (geiser-syntax--read/next-token)))))))
       (?\' (geiser-syntax--read/token '(quote . quote)))
       (?\` (geiser-syntax--read/token
@@ -266,11 +266,7 @@ implementation-specific entries for font-lock-keywords.")
 
 (defsubst geiser-syntax--symbol-at-point ()
   (and (not (nth 8 (syntax-ppss)))
-       (let ((s (thing-at-point 'symbol)))
-         (and s
-              (not (equal s "."))
-              (not (string-match "^#[^:]" s)) ;; quack modifies thing-at-point
-              (make-symbol (substring-no-properties s))))))
+       (car (geiser-syntax--read-from-string (thing-at-point 'symbol)))))
 
 (defsubst geiser-syntax--skip-comment/string ()
   (let ((pos (nth 8 (syntax-ppss))))
@@ -294,10 +290,8 @@ implementation-specific entries for font-lock-keywords.")
             (when (<= (point) boundary)
               (forward-sexp)
               (let ((s (thing-at-point 'symbol)))
-                (cond ((not s) (push s elems))
-                      ((member s '("#" "`" "'")) (push nil elems))
-                      ((string-match "^#[^:]" s) (push nil elems)) ;; quack
-                      ((not (equal "." s)) (push (make-symbol s) elems)))))))
+                (unless (equal "." s)
+                  (push (car (geiser-syntax--read-from-string s)) elems))))))
         (nreverse elems)))))
 
 (defsubst geiser-syntax--keywordp (s)
-- 
cgit v1.2.3