From e5d47bade42f49e744c67f3c05b6885abb14df08 Mon Sep 17 00:00:00 2001
From: Ludovic Courtès
Date: Thu, 9 Oct 2008 23:50:53 +0200
Subject: justify: Remove unused bindings.

* src/guile/skribilo/utils/justify.scm (*justifiers*, pre-output,
  post-output, strtok, my-string-append): Remove.
  (tokens-justify)[reverse-line]: Remove.
  (tokens-justify): Use `string-concatenate' instead of `apply
  string-append'.
---
 src/guile/skribilo/utils/justify.scm | 44 +++++++-----------------------------
 1 file changed, 8 insertions(+), 36 deletions(-)

(limited to 'src')

diff --git a/src/guile/skribilo/utils/justify.scm b/src/guile/skribilo/utils/justify.scm
index 969cd30..de9bbda 100644
--- a/src/guile/skribilo/utils/justify.scm
+++ b/src/guile/skribilo/utils/justify.scm
@@ -20,6 +20,7 @@
 ;;; USA.
 
 (define-module (skribilo utils justify)
+  :use-module (srfi srfi-13)
   :export (make-justifier output-flush
 
 	   *text-column-width*
@@ -86,11 +87,6 @@
 			  (lambda ()
 			     (output str)))))
 
-;*---------------------------------------------------------------------*/
-;*    *justifiers* ...                                                 */
-;*---------------------------------------------------------------------*/
-(define *justifiers* (list (make-justifier *text-column-width*
-					   *text-justification*)))
 (define *margin* 0)
 
 ;*---------------------------------------------------------------------*/
@@ -113,19 +109,7 @@
 ;*---------------------------------------------------------------------*/
 (define (output-newline)
    ((car *justifiers*) 'newline))
-   
-;*---------------------------------------------------------------------*/
-;*    pre-output ...                                                   */
-;*---------------------------------------------------------------------*/
-(define (pre-output val)
-   ((car *justifiers*) 'pre val))
-   
-;*---------------------------------------------------------------------*/
-;*    post-output ...                                                  */
-;*---------------------------------------------------------------------*/
-(define (post-output val)
-   ((car *justifiers*) 'post val))
-   
+
 ;*---------------------------------------------------------------------*/
 ;*    output-flush ...                                                 */
 ;*---------------------------------------------------------------------*/
@@ -175,12 +159,6 @@
 ;*---------------------------------------------------------------------*/
 (define *spaces* '(#\Space #\Tab #\Newline))
 
-;*---------------------------------------------------------------------*/
-;*    strtok ...                                                       */
-;*---------------------------------------------------------------------*/
-(define (strtok str delims)
-   (reverse (kotrts str delims)))
-
 ;*---------------------------------------------------------------------*/
 ;*    kotrts ...                                                       */
 ;*---------------------------------------------------------------------*/
@@ -314,13 +292,6 @@
 ;*    tokens-justify ...                                               */
 ;*---------------------------------------------------------------------*/
 (define (tokens-justify justifier tokens width)
-   (define (reverse-line lines)
-      (let ((nl (string #\Newline)))
-         (let loop ((ls lines)
-                    (acc ""))
-            (if (null? ls)
-                acc
-                (loop (cdr ls) (string-append (car ls) nl acc))))))
    (let loop ((tokens    tokens)
               (line-len  0)
               (line     '())
@@ -372,7 +343,7 @@
 		((newline)
 		 (set! tokens (cons "\n" tokens)))
 		((flush)
-		 (let ((str (apply string-append (reverse! tokens))))
+		 (let ((str (string-concatenate (reverse! tokens))))
 		    (set! tokens '())
 		    (list str)))
 		((width)
@@ -426,10 +397,11 @@
 		   (else
 		    (error "justifier" "Illegal command" cmd))))))))
 
-(define (my-string-append . s)
-   (newline (current-error-port))
-   (format (current-error-port) "s: ~a~%" s)
-   (apply string-append s))
+;*---------------------------------------------------------------------*/
+;*    *justifiers* ...                                                 */
+;*---------------------------------------------------------------------*/
+(define *justifiers* (list (make-justifier *text-column-width*
+					   *text-justification*)))
 
 
 ;;; justify.scm ends here
-- 
cgit v1.2.3