summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2011-01-02 21:03:00 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2011-01-02 21:03:00 +0100
commit95af5d35139f8d8825dcfa2381a5bc16d46e0043 (patch)
treee0a97f5b522ff5f2dc967d377cea9d5c3584f34e /elisp
parent31215149401ca11ca6365109411206e25b6a3b6d (diff)
downloadgeiser-chez-95af5d35139f8d8825dcfa2381a5bc16d46e0043.tar.gz
geiser-chez-95af5d35139f8d8825dcfa2381a5bc16d46e0043.tar.bz2
More robust symbol reading (instead of specializing for quack)
Let's use the scheme reader instead of half-assed regular expressions and special-casing.
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-syntax.el14
1 files 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)