From a2122418aee69b35e1dd08e57ef6f619c17680dd Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Mon, 19 Aug 2013 02:37:12 -0400 Subject: [PATCH] Fix a use of `fresh-line'. Needs to do it when the relevant stderr is in effect. Fixes PR 13744, except that something like this is still bad: (with-output-to-file "/tmp/foo" #:exists 'append (lambda () (parameterize ([current-error-port (current-output-port)]) (/ 1 0)))) But I think that it's a bad idea for the error display handler to be called with the locally set port -- described in PR 13974. --- pkgs/xrepl-pkgs/xrepl-lib/xrepl/xrepl.rkt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/xrepl-pkgs/xrepl-lib/xrepl/xrepl.rkt b/pkgs/xrepl-pkgs/xrepl-lib/xrepl/xrepl.rkt index 58aba09515..e117441951 100644 --- a/pkgs/xrepl-pkgs/xrepl-lib/xrepl/xrepl.rkt +++ b/pkgs/xrepl-pkgs/xrepl-lib/xrepl/xrepl.rkt @@ -1457,7 +1457,6 @@ ;; a display handler that omits stacktraces (making them available later) (define ((make-xrepl-display-handler orig) str exn) - (fresh-line #t) (define backtrace? (parameterize ([current-error-port (open-output-string)]) (orig str exn) @@ -1477,6 +1476,7 @@ [s (if backtrace? (string-append s (if (regexp-match? #rx"\n" s) "\n; " " ") msg) s)]) + (fresh-line #t) (with-wrapped-output (printf "; ~a\n" s))))) ;; ----------------------------------------------------------------------------