* module/ice-9/format.scm (format): Allow ~:@y to interpret the width as
the maximum width, inclusive of whatever else has already been output.
* doc/ref/misc-modules.texi (Formatted Output): Document this.
within @var{width} columns (79 by default), on a single line. The
output will be truncated if necessary.
+@nicode{~:@@y} is like @nicode{~@@y}, except the @var{width} parameter
+is interpreted to be the maximum column to which to output. That is to
+say, if you are at column 10, and @nicode{~60:@@y} is seen, the datum
+will be truncated to 50 columns.
+
@item @nicode{~?}
@itemx @nicode{~k}
Sub-format. No parameters.
(car params)
79)))
(case modifier
- ((colon colon-at)
- (format:error "illegal modifier in ~~?"))
((at)
(format:out-str
(with-output-to-string
(lambda ()
- (truncated-print (next-arg) #:width width)))))
+ (truncated-print (next-arg)
+ #:width width)))))
+ ((colon-at)
+ (format:out-str
+ (with-output-to-string
+ (lambda ()
+ (truncated-print (next-arg)
+ #:width
+ (max (- width
+ format:output-col)
+ 1))))))
+ ((colon)
+ (format:error "illegal modifier in ~~?"))
(else
(pretty-print (next-arg) format:port
#:width width)