Steve Sprang <steve.spr...@gmail.com> writes: > Here's attempt #2. [...] > @@ -101,15 +101,14 @@ width of the bar is BAR-WIDTH." > > (define (string-pad-middle left right len) > "Combine LEFT and RIGHT with enough padding in the middle so that the > -resulting string has length at least LEN. This right justifies RIGHT." > - (string-append left > - (string-pad right (max 0 (- len (string-length left)))))) > - > -(define (store-url-abbreviation url) > - "Return a friendlier version of URL for display." > - (let ((store-path (string-append (%store-directory) "/" (basename url)))) > - ;; Take advantage of the implementation for store paths. > - (store-path-abbreviation store-path))) > +resulting string has length at least LEN (it may overflow). If the string > +does not overflow, the last char in RIGHT will be flush with the LEN > +column." > + (let* ((total-used (+ (string-length left) > + (string-length right))) > + (num-spaces (max 1 (- len total-used))) > + (padding (make-string num-spaces #\space))) > + (string-append left padding right)))
The phrasing is fine for me. Thanks again. -- Mathieu Lirzin