From b054af81c2c3fafdb085830881251ab2bc3e3b73 Mon Sep 17 00:00:00 2001 From: Ryan Culpepper Date: Sat, 19 Dec 2009 04:41:44 +0000 Subject: [PATCH] macro-debugger: pretty-print copied syntax svn: r17355 original commit: be6fb953bc1c767927557484e2da2528d421ba60 --- collects/macro-debugger/syntax-browser/keymap.ss | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/collects/macro-debugger/syntax-browser/keymap.ss b/collects/macro-debugger/syntax-browser/keymap.ss index 5c43929..e462cf7 100644 --- a/collects/macro-debugger/syntax-browser/keymap.ss +++ b/collects/macro-debugger/syntax-browser/keymap.ss @@ -1,6 +1,7 @@ #lang scheme/base (require scheme/class scheme/gui + scheme/pretty unstable/gui/notify "interfaces.ss" "partition.ss") @@ -54,11 +55,12 @@ (add-function "copy-syntax-as-text" (lambda (_ event) (define stx (send controller get-selected-syntax)) - (send the-clipboard set-clipboard-string - (if stx - (format "~s" (syntax->datum stx)) - "") - (send event get-time-stamp)))) + (when stx + (send the-clipboard set-clipboard-string + (let ([out (open-output-string)]) + (pretty-print (syntax->datum stx) out) + (get-output-string out)) + (send event get-time-stamp))))) (add-function "clear-syntax-selection" (lambda (i e)