Abstracted out a function to set printing parameters for the

macro debugger and the syntax browser.

Set all printing parameters to their defaults (as observed
from both mzscheme and drscheme).

svn: r16254

original commit: cf5c0a1b08b48b621b7fa2b64507d49af56019af
This commit is contained in:
Carl Eastlund 2009-10-06 21:33:54 +00:00
parent 85a0ef9a5a
commit 64b1c3f7bc
3 changed files with 17 additions and 20 deletions

View File

@ -107,16 +107,8 @@
(parameterize (parameterize
([pretty-print-size-hook pp-size-hook] ([pretty-print-size-hook pp-size-hook]
[pretty-print-print-hook pp-print-hook] [pretty-print-print-hook pp-print-hook]
[pretty-print-current-style-table (pp-extend-style-table)] [pretty-print-current-style-table (pp-extend-style-table)])
;; Printing parameters (mzscheme manual 7.9.1.4) (pretty-print/defaults datum)))
[print-unreadable #t]
[print-graph #f]
[print-struct #f]
[print-box #t]
[print-vector-length #t]
[print-hash-table #f]
[print-honu #f])
(pretty-print datum)))
(define (->show-function show) (define (->show-function show)
(cond [(procedure? show) (cond [(procedure? show)

View File

@ -1,6 +1,7 @@
#lang scheme/base #lang scheme/base
(require scheme/class (require scheme/class
scheme/pretty
macro-debugger/util/class-iop macro-debugger/util/class-iop
syntax/stx syntax/stx
"interfaces.ss") "interfaces.ss")
@ -20,6 +21,18 @@
;; If they were always wrapped, the pretty-printer would screw up ;; If they were always wrapped, the pretty-printer would screw up
;; list printing (I think). ;; list printing (I think).
(define (pretty-print/defaults datum [port (current-output-port)])
(parameterize
(;; Printing parameters (defaults from MzScheme and DrScheme 4.2.2.2)
[print-unreadable #t]
[print-graph #f]
[print-struct #t]
[print-box #t]
[print-vector-length #f]
[print-hash-table #t]
[print-honu #f])
(pretty-print datum port)))
(define-struct syntax-dummy (val)) (define-struct syntax-dummy (val))
;; A SuffixOption is one of ;; A SuffixOption is one of

View File

@ -52,16 +52,8 @@
[pretty-print-size-hook pp-size-hook] [pretty-print-size-hook pp-size-hook]
[pretty-print-print-hook pp-print-hook] [pretty-print-print-hook pp-print-hook]
[pretty-print-current-style-table (pp-extend-style-table identifier-list)] [pretty-print-current-style-table (pp-extend-style-table identifier-list)]
[pretty-print-columns columns] [pretty-print-columns columns])
;; Printing parameters (mzscheme manual 7.9.1.4) (pretty-print/defaults datum port)
[print-unreadable #t]
[print-graph #f]
[print-struct #t]
[print-box #t]
[print-vector-length #t]
[print-hash-table #f]
[print-honu #f])
(pretty-print datum port)
(new range% (new range%
(range-builder range-builder) (range-builder range-builder)
(identifier-list identifier-list)))) (identifier-list identifier-list))))