>From 9ff3dcf3a1f3b1b395659d956c15f07b5b028e38 Mon Sep 17 00:00:00 2001 From: Sahithi Yarlagadda Date: Sat, 30 Jun 2018 03:58:47 +0530 Subject: [PATCH] guix: Adding Spinner to replace the Build Messages. * guix/ui.scm (handle-string): Calling the Spinner except for colored messages. (spin-str): New variable. --- guix/ui.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/guix/ui.scm b/guix/ui.scm index 88e5fa6b7..2bacffbf1 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -1662,8 +1662,9 @@ unmodified input string." (colorize-string (match:substring m 5) 'RED)))) ;; Didn’t match with any expression, returns back unmodified string. - str))) - (display message (current-error-port)))) + (spin-str) + ))) + (display (string-append (string #\backspace) message) (current-error-port)))) (define colorful-build-output-port (make-soft-port @@ -1677,5 +1678,12 @@ unmodified input string." (lambda () (display "@" (current-error-port)))) "rw")) +(define spin-str + (let ((chars (string->list "\\|/-")) + (index -1)) + (lambda () (set! index (modulo (+ index 1) + (length chars))) + (list->string (list #\backspace(list-ref chars index) ))))) + ;;; ui.scm ends here -- 2.17.1