[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 15/18: Fix allow-newline? in call-with-truncating-output
From: |
Andy Wingo |
Subject: |
[Guile-commits] 15/18: Fix allow-newline? in call-with-truncating-output-string |
Date: |
Thu, 8 Jun 2023 04:26:43 -0400 (EDT) |
wingo pushed a commit to branch main
in repository guile.
commit 5af66570bb2b4a0f6b47361f9d028d4ef42d8b46
Author: Andy Wingo <wingo@pobox.com>
AuthorDate: Fri Jun 2 22:21:23 2023 +0200
Fix allow-newline? in call-with-truncating-output-string
* module/ice-9/pretty-print.scm (call-with-truncating-output-string):
Actually detect newlines.
---
module/ice-9/pretty-print.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/module/ice-9/pretty-print.scm b/module/ice-9/pretty-print.scm
index 21a80e9a5..38d05b7f3 100644
--- a/module/ice-9/pretty-print.scm
+++ b/module/ice-9/pretty-print.scm
@@ -36,7 +36,9 @@
(define (write-string str)
(set! length (+ length (string-length str)))
(set! strs (cons str strs))
- (when (< (- max-column initial-column) length)
+ (when (or (< (- max-column initial-column) length)
+ (and (not allow-newline?)
+ (not (zero? (port-line port)))))
(abort-to-prompt tag)))
(define port
(make-soft-port #:id "truncating-output-port"
- [Guile-commits] 07/18: Use custom binary output ports for make-chunked-output-port, (continued)
- [Guile-commits] 07/18: Use custom binary output ports for make-chunked-output-port, Andy Wingo, 2023/06/08
- [Guile-commits] 13/18: Inline generic-write into pretty-print, Andy Wingo, 2023/06/08
- [Guile-commits] 10/18: Modernize soft ports, Andy Wingo, 2023/06/08
- [Guile-commits] 01/18: pretty-print: Use string-concatenate-reverse, Andy Wingo, 2023/06/08
- [Guile-commits] 17/18: Deprecate (ice-9 lineio), Andy Wingo, 2023/06/08
- [Guile-commits] 18/18: Fix exn dispatch for exns within pre-unwind handlers, Andy Wingo, 2023/06/08
- [Guile-commits] 09/18: Implement R6RS custom textual ports, Andy Wingo, 2023/06/08
- [Guile-commits] 11/18: Rewrite pretty-print to rely on port-column, abort early, Andy Wingo, 2023/06/08
- [Guile-commits] 14/18: truncated-print: use call-with-truncating-output-string, Andy Wingo, 2023/06/08
- [Guile-commits] 12/18: pretty-print: width arg is never false, Andy Wingo, 2023/06/08
- [Guile-commits] 15/18: Fix allow-newline? in call-with-truncating-output-string,
Andy Wingo <=
- [Guile-commits] 02/18: pretty-print: inline genwrite:newline-str, Andy Wingo, 2023/06/08