For stacktrace, use error-print-context-length to suppress it:

(define (print-exn exn)
  (parameterize ([error-print-context-length 0])
    ((error-display-handler)
     (if (exn? exn)
         (exn-message exn)
         (format "~a" exn))
     exn)))

I don’t see any extra newline though.

On Thu, Aug 27, 2020 at 3:11 PM Shriram Krishnamurthi <[email protected]>
wrote:

> This is perfect, thanks!
>
> Two follow-up questions:
>
> 1. The error printer seems to print an extra newline at the end relative
> to what the port-display-handler (for instance) shows. Is there a way to
> suppress that?
>
> 2. The stack trace seems to be extracted automatically. Is there a way to
> suppress it entirely?
>
> Shriram
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CAJUf2yQyVat2Fy63hdDqRv9iaq40Zsf_6TQJsLU%3DETB30zCE0Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/racket-users/CAJUf2yQyVat2Fy63hdDqRv9iaq40Zsf_6TQJsLU%3DETB30zCE0Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CADcuegsxbKF6CZi01J0mduxo9vS5U2QDjn5M-jA12h21NB02PA%40mail.gmail.com.

Reply via email to