summaryrefslogtreecommitdiff
path: root/elisp/geiser-syntax.el
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
commit78554a9c2bbbe59b007f85c8ee113b9a449db231 (patch)
tree3649830c8a5c0ad102cf54e32efb40730e450659 /elisp/geiser-syntax.el
parent151edf5b090a95748c31e906ae22afa163e438bf (diff)
downloadgeiser-78554a9c2bbbe59b007f85c8ee113b9a449db231.tar.gz
geiser-78554a9c2bbbe59b007f85c8ee113b9a449db231.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/geiser-syntax.el')
-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)