dannym pushed a commit to branch wip-installer-2
in repository guix.
commit 1554d6875e1c106ccda9edcae6b6f08b73f07011
Author: John Darrington <[email protected]>
Date: Sun Jan 22 16:06:01 2017 +0100
installer: Delete unused procedure "justify".
* gnu/system/installer/utils.scm (justify): Delete procedure.
---
gnu/system/installer/utils.scm | 28 +---------------------------
1 file changed, 1 insertion(+), 27 deletions(-)
diff --git a/gnu/system/installer/utils.scm b/gnu/system/installer/utils.scm
index 47b8cd7..96f49ac 100644
--- a/gnu/system/installer/utils.scm
+++ b/gnu/system/installer/utils.scm
@@ -17,7 +17,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu system installer utils)
- #:export (justify
+ #:export (
justify*
addstr*
slurp
@@ -106,32 +106,6 @@
(close-port (car pipep))))
(cdr (waitpid pid))))
-(define (justify text width)
- "A naive function to split a string into lines no more than width characters
long."
- (define (justify' l n acc)
- (if (null? l)
- acc
- (let* ((word (car l))
- (len (string-length word)))
-
- (define (linefull? n w)
- (> (+ len n) w))
-
- (justify'
- (if (linefull? n width)
- l
- (cdr l))
- (if (linefull? n width)
- 0
- (+ n (1+ len)))
-
- (if (linefull? n width)
- (string-append acc
- (make-string (- width len) #\space))
- (string-append acc word " "))))))
-
- (justify' (string-split text char-set:blank) 0 ""))
-
(define (justify* text width)
"A naive function to split a string into lines no more than width characters
long.
This version assumes some external entity puts in the carriage returns."