From 47a8174ad8c67b0107b9599b040ff17fdc2aacb9 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Fri, 6 Dec 2019 12:42:29 -0800 Subject: [PATCH] better naming --- quad/quadwriter/lang-helper.rkt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/quad/quadwriter/lang-helper.rkt b/quad/quadwriter/lang-helper.rkt index e57bf2e0..6cb47ec4 100644 --- a/quad/quadwriter/lang-helper.rkt +++ b/quad/quadwriter/lang-helper.rkt @@ -1,6 +1,7 @@ #lang debug racket/base (require (for-syntax racket/base) racket/match + racket/path racket/dict pollen/tag racket/system @@ -98,7 +99,11 @@ ;; '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")]))) + [_ (define path-without-ext (path-replace-extension path-string #"")) + ;; do the right thing with pollen-style double extension like "foo.pdf.pm" + (if (path-has-extension? path-without-ext #".pdf") + path-without-ext + (path-add-extension path-without-ext #".pdf"))]))) (define quad-at-reader (make-at-reader #:syntax? #t