commit 763a1a1b7d654f956d668a420d6ded763e85e8e5
parent a1b7be1a9024b5545e814a135e771eb2f0cbd255
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Sun, 15 Mar 2009 13:30:26 +0000
change render og var-ids under a quote
svn: r14108
original commit: 073013d8eff555d555bba470733eb0bd21855681
Diffstat:
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/collects/scribble/scheme.ss b/collects/scribble/scheme.ss
@@ -123,7 +123,8 @@
(make-element style content)))
(define (typeset-atom c out color? quote-depth)
- (if (var-id? (syntax-e c))
+ (if (and (var-id? (syntax-e c))
+ (zero? quote-depth))
(out (format "~s" (let ([v (var-id-sym (syntax-e c))])
(if (syntax? v)
(syntax-e v)
@@ -135,7 +136,9 @@
(let ([sc (syntax-e c)])
(let ([s (format "~s" (if (literal-syntax? sc)
(literal-syntax-stx sc)
- sc))])
+ (if (var-id? sc)
+ (var-id-sym sc)
+ sc)))])
(if (and (symbol? sc)
((string-length s) . > . 1)
(char=? (string-ref s 0) #\_)
diff --git a/collects/scribblings/scribble/scheme.scrbl b/collects/scribblings/scribble/scheme.scrbl
@@ -90,7 +90,8 @@ typically used to typeset results.}
When @scheme[to-paragraph] and variants encounter a @scheme[var-id]
structure, it is typeset as @scheme[sym] in the variable font, like
-@scheme[schemevarfont].}
+@scheme[schemevarfont]---unless the @scheme[var-id] appears under
+quote or quasiquote, in which case @scheme[sym] is typeset as a symbol.}
@defstruct[shaped-parens ([val any/c]
@@ -149,4 +150,5 @@ Provided @scheme[for-syntax]; returns @scheme[#t] if @scheme[v] is an
Provided @scheme[for-syntax]; like @scheme[element-id-transformer] for
a transformer that produces @scheme[sym] typeset as a variable (like
-@scheme[schemevarfont]).}
+@scheme[schemevarfont])---unless it appears under quote or quasiquote,
+in which case @scheme[sym] is typeset as a symbol.}