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.
This commit is contained in:
Eli Barzilay 2013-08-19 02:37:12 -04:00
parent 0e1a380f49
commit a2122418ae

View File

@ -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)))))
;; ----------------------------------------------------------------------------