branch: elpa/geiser-chicken
commit 2caa2847dfd3ad836104a28a682f6a16982c7335
Author: Dan Leslie <[email protected]>
Commit: Dan Leslie <[email protected]>
Fixes autodoc in Chicken, #258
---
geiser/chicken5.scm | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/geiser/chicken5.scm b/geiser/chicken5.scm
index 6c8ceae..5409058 100644
--- a/geiser/chicken5.scm
+++ b/geiser/chicken5.scm
@@ -142,11 +142,18 @@
(newline)))
(define (eval* str)
- (handle-exceptions exn #f
- (with-all-output-to-string
- (eval
- (with-input-from-string (->string str)
- (lambda () (read)))))))
+ (cond
+ ((string? str)
+ (handle-exceptions exn
+ (with-all-output-to-string (write-exception exn))
+ (eval
+ (with-input-from-string str
+ (lambda () (read))))))
+ ((symbol? str)
+ (handle-exceptions exn
+ (with-all-output-to-string (write-exception exn))
+ (eval str)))
+ (else (eval* (->string str)))))
(define (fmt node)
(let* ((mod (cadr node))