From 9ff3eabb039f781d7848fb4bce6f0094948b5b89 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Tue, 30 Oct 2018 18:52:49 -0700 Subject: [PATCH] motion --- pollen/cache.rkt | 4 +++- pollen/private/cache-utils.rkt | 5 +++-- pollen/render.rkt | 6 +++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pollen/cache.rkt b/pollen/cache.rkt index 338d08d..1bacd69 100644 --- a/pollen/cache.rkt +++ b/pollen/cache.rkt @@ -48,7 +48,9 @@ (hash-ref ram-cache-record subkey)] [else (parameterize ([current-namespace (make-base-namespace)]) - (namespace-attach-module (namespace-anchor->namespace cache-module-ns) 'pollen/setup) ; brings in currently instantiated params (unlike namespace-require) + ;; brings in currently instantiated params (unlike namespace-require) + (define outer-ns (namespace-anchor->namespace cache-module-ns)) + (namespace-attach-module outer-ns 'pollen/setup) (dynamic-require path subkey))])))) (define+provide (cached-require path-string subkey) diff --git a/pollen/private/cache-utils.rkt b/pollen/private/cache-utils.rkt index c5cd635..19e4398 100644 --- a/pollen/private/cache-utils.rkt +++ b/pollen/private/cache-utils.rkt @@ -61,8 +61,9 @@ ;; otherwise it gets cached in current namespace. (parameterize ([current-namespace (make-base-namespace)] [current-directory (dirname path)]) - (namespace-attach-module - (namespace-anchor->namespace cache-utils-module-ns) 'pollen/setup) ; brings in currently instantiated params (unlike namespace-require) + ;; brings in currently instantiated params (unlike namespace-require) + (define outer-ns (namespace-anchor->namespace cache-utils-module-ns)) + (namespace-attach-module outer-ns 'pollen/setup) (define doc-missing-thunk (λ () "")) (define metas-missing-thunk (λ () (hasheq))) (list doc-key (dynamic-require path doc-key doc-missing-thunk) diff --git a/pollen/render.rkt b/pollen/render.rkt index 11dee3b..434f812 100644 --- a/pollen/render.rkt +++ b/pollen/render.rkt @@ -177,9 +177,9 @@ ;; make fresh namespace for scribble rendering (avoids dep/zo caching) (parameterize ([current-namespace (make-base-namespace)] [current-directory (->complete-path source-dir)]) - (define ns (namespace-anchor->namespace render-module-ns)) - (namespace-attach-module ns 'scribble/core) - (namespace-attach-module ns 'scribble/manual) + (define outer-ns (namespace-anchor->namespace render-module-ns)) + (namespace-attach-module outer-ns 'scribble/core) + (namespace-attach-module outer-ns 'scribble/manual) ;; scribble/lp files have their doc export in a 'doc submodule, so check both locations (match (cond [(dynamic-require source-path 'doc (λ () #false))]