~ chicken-core (chicken-5) d1eac90290c6d8ad4389d428eb7ed5eaddebfad3


commit d1eac90290c6d8ad4389d428eb7ed5eaddebfad3
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Mon Nov 22 04:59:25 2010 -0500
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Mon Nov 22 04:59:25 2010 -0500

    different layout for feature-list in csi ,r command

diff --git a/csi.scm b/csi.scm
index 137e5101..88cdcc4a 100644
--- a/csi.scm
+++ b/csi.scm
@@ -444,15 +444,24 @@ EOF
 	  (let ([sinfo (##sys#symbol-table-info)]
 		[minfo (memory-statistics)] )
 	    (define (shorten n) (/ (truncate (* n 100)) 100))
-	    (printf "Features:\n")
-	    (for-each
-	     (lambda (lst) 
-	       (display "\n  ")
-	       (for-each 
-		(lambda (f)
-		  (printf "~a~a" f (make-string (fxmax 1 (fx- 16 (string-length f))) #\space)) )
-		lst) )
-	     (chop (sort (map keyword->string ##sys#features) string<?) 5))
+	    (printf "Features:~%~%")
+	    (let ((fs (sort (map keyword->string ##sys#features) string<?))
+		  (c 0))
+	      (for-each
+	       (lambda (f)
+		 (printf "  ~a" f)
+		 (let* ((len (string-length f))
+			(pad (- 16 len)))
+		   (set! c (add1 c))
+		   (when (<= pad 0)
+		     (set! c (add1 c))
+		     (set! pad (+ pad 18)))
+		   (cond ((>= c 3)
+			  (display "\n")
+			  (set! c 0))
+			 (else 
+			  (display (make-string pad #\space))))))
+	       fs))
 	    (printf "~%~%~
                    Machine type:    \t~A ~A~%~
                    Software type:   \t~A~%~
Trap