diff options
-rw-r--r-- | pict.scm | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -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)))) |