summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pict.scm15
1 files changed, 5 insertions, 10 deletions
diff --git a/pict.scm b/pict.scm
index 58d3394..25cc21b 100644
--- a/pict.scm
+++ b/pict.scm
@@ -139,16 +139,11 @@ the file to determine the file name. Return the file name."
;; Hey, where are you going? You haven't seen the rest...!
(set-record-type-printer! <pict>
(lambda (record port)
- (let* ((xml (with-output-to-string
- (lambda _ (sxml->xml `(svg (@ (width ,(pict-width record))
- (height ,(pict-height record))
- (xmlns "http://www.w3.org/2000/svg"))
- ,(pict-sxml record))))))
- (name (string-append "/tmp/geiser-"
- (number->string (string-hash xml))
- ".svg")))
- (with-output-to-file name
- (lambda _ (display xml)))
+ (let ((name (pict->file record
+ (lambda (xml)
+ (string-append "/tmp/geiser-"
+ (number->string (string-hash xml))
+ ".svg")))))
(format port "#<Image: ~a>" name))))