diff --git a/pkgs/scribble-pkgs/scribble-lib/scribble/base.rkt b/pkgs/scribble-pkgs/scribble-lib/scribble/base.rkt index c7413c9e..2e32ea60 100644 --- a/pkgs/scribble-pkgs/scribble-lib/scribble/base.rkt +++ b/pkgs/scribble-pkgs/scribble-lib/scribble/base.rkt @@ -118,14 +118,14 @@ (define-syntax (include-section stx) (syntax-case stx () [(_ mod) - (with-syntax ([mod (syntax-local-introduce #'mod)]) + (with-syntax ([doc-from-mod (datum->syntax #'mod 'doc)]) (unless (module-path? (syntax->datum #'mod)) (raise-syntax-error #f "not a module path" stx #'mod)) #'(begin - (require (only-in mod doc)) + (require (only-in mod [doc-from-mod doc])) doc))])) ;; ---------------------------------------- diff --git a/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/include-section.scrbl b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/include-section.scrbl new file mode 100644 index 00000000..b09b87a2 --- /dev/null +++ b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/include-section.scrbl @@ -0,0 +1,6 @@ +#lang scribble/base + +@; Check that a macro-introduced `include-section' works: +@(define-syntax-rule (inc) (include-section "diamond.scrbl")) + +@(inc) diff --git a/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/include-section.txt b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/include-section.txt new file mode 100644 index 00000000..2da76d86 --- /dev/null +++ b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/include-section.txt @@ -0,0 +1,7 @@ +1. + +This example checks that @ is not an escape character if we make a +reader that uses a different escape character. + +It also makes sure that a non-ASCII character like diamond is ok as an +escape character.