From c1ca8e705bcfbe183ebb7cbbf929920c10d808e8 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 21 Aug 2019 12:22:56 -0700 Subject: [PATCH] stringy --- quad/quadwriter/lang-helper.rkt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/quad/quadwriter/lang-helper.rkt b/quad/quadwriter/lang-helper.rkt index 637427b6..8a968159 100644 --- a/quad/quadwriter/lang-helper.rkt +++ b/quad/quadwriter/lang-helper.rkt @@ -58,7 +58,7 @@ (for ([kvlist (in-list 'ATTRS)]) (apply hash-set! h kvlist)) h)) - (define pdf-path (hash-ref! attrs 'output-path (λ () (path-string->pdf-path 'PATH-STRING)))) + (define pdf-path (hash-ref! attrs 'output-path (λ () (path-string->pdf-path-string 'PATH-STRING)))) (define DOC `(q ,(for/list ([(k v) (in-hash attrs)]) (list k v)) ,(DOC-PROC (list . EXPRS)))) @@ -82,13 +82,14 @@ #:logger quad-logger 'debug))))])))) -(define (path-string->pdf-path path-string) +(define (path-string->pdf-path-string path-string) + (path->string (match (format "~a" path-string) ;; weird test but sometimes DrRacket calls the unsaved file ;; 'unsaved-editor and sometimes "unsaved editor" [(regexp #rx"unsaved.editor") (build-path (find-system-path 'desk-dir) "untitled.pdf")] - [_ (path-replace-extension path-string #".pdf")])) + [_ (path-replace-extension path-string #".pdf")]))) (define quad-at-reader (make-at-reader #:syntax? #t