From 6f6adbf3a1b598d2dd15fdc72e16859e76d225d3 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Fri, 6 Jun 2008 05:35:55 +0000 Subject: [PATCH] hack value-port handler svn: r10164 --- collects/swindle/tool.ss | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/collects/swindle/tool.ss b/collects/swindle/tool.ss index 0f4a2bf539..ffcbd0b7fb 100644 --- a/collects/swindle/tool.ss +++ b/collects/swindle/tool.ss @@ -9,7 +9,8 @@ mzlib/list mred net/sendurl - string-constants) + string-constants + swindle/extra) (provide tool@) (define tool@ @@ -103,6 +104,19 @@ [(none) 0] [(debug) 1] [(debug/profile) 2]))]))) + (define last-port #f) + (define/override (render-value/format value settings port width) + (unless (eq? port last-port) + (set! last-port port) + ;; this is called with the value port, so copy the usual swindle + ;; handlers to this port + (port-write-handler + port (port-write-handler (current-output-port))) + (port-display-handler + port (port-display-handler (current-output-port)))) + ;; then use them instead of the default pretty print + (write value port) + (newline port)) (super-instantiate ()))) (define (add-swindle-language name module entry-name num one-line url) (drscheme:language-configuration:add-language