GNU bug report logs - #27566
[PATCH] ui: spinner-port: New variable. Export it.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Danny Milosavljevic <dannym@HIDDEN>; Keywords: patch; dated Mon, 3 Jul 2017 18:56:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Jul 2017 18:55:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 03 14:55:40 2017
Received: from localhost ([127.0.0.1]:50718 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dS6VY-0007jI-2I
	for submit <at> debbugs.gnu.org; Mon, 03 Jul 2017 14:55:40 -0400
Received: from eggs.gnu.org ([208.118.235.92]:40574)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1dS6VV-0007j5-Sh
 for submit <at> debbugs.gnu.org; Mon, 03 Jul 2017 14:55:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <dannym@HIDDEN>) id 1dS6VP-0005M7-Sy
 for submit <at> debbugs.gnu.org; Mon, 03 Jul 2017 14:55:32 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_00,
 UNWANTED_LANGUAGE_BODY autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:38415)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <dannym@HIDDEN>)
 id 1dS6VP-0005Lw-Pg
 for submit <at> debbugs.gnu.org; Mon, 03 Jul 2017 14:55:31 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:59766)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <dannym@HIDDEN>) id 1dS6VO-0006vb-6N
 for guix-patches@HIDDEN; Mon, 03 Jul 2017 14:55:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <dannym@HIDDEN>) id 1dS6VL-0005FC-Kx
 for guix-patches@HIDDEN; Mon, 03 Jul 2017 14:55:30 -0400
Received: from dd1012.kasserver.com ([85.13.128.8]:37362)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <dannym@HIDDEN>)
 id 1dS6VL-0005Cd-Ek
 for guix-patches@HIDDEN; Mon, 03 Jul 2017 14:55:27 -0400
Received: from dayas.3.home (178.113.214.100.wireless.dyn.drei.com
 [178.113.214.100])
 by dd1012.kasserver.com (Postfix) with ESMTPSA id 6DC071CA0466;
 Mon,  3 Jul 2017 20:55:23 +0200 (CEST)
From: Danny Milosavljevic <dannym@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] ui: spinner-port: New variable.  Export it.
Date: Mon,  3 Jul 2017 20:55:20 +0200
Message-Id: <20170703185520.4475-1-dannym@HIDDEN>
X-Mailer: git-send-email 2.12.1
Tags: patch
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
Cc: Danny Milosavljevic <dannym@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

* guix/ui.scm (spinner-port): New variable.  Export it.
---
 guix/ui.scm | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/guix/ui.scm b/guix/ui.scm
index 4bad00e8c..0930ed2b7 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -102,7 +102,8 @@
             guix-warning-port
             warning
             info
-            guix-main))
+            guix-main
+            spinner-port))
 
 ;;; Commentary:
 ;;;
@@ -110,6 +111,26 @@
 ;;;
 ;;; Code:
 
+(define spinner-port
+  (let ((index 0)
+        (spinner-chars "|\\-/"))
+    (define previous-output-port (current-error-port))
+    (define (spin)
+      (set! index (+ index 1))
+      (if (>= index (string-length spinner-chars))
+        (set! index 0))
+      (display (array-ref spinner-chars index) previous-output-port)
+      (display #\backspace previous-output-port)
+      (force-output previous-output-port))
+    (make-soft-port
+           (vector
+            (lambda (c) (if (char=? c #\newline) (spin))) ; putc
+            (lambda (s) (if (string-contains s "\n") (spin))) ; puts
+            (lambda () #t) ; flusher
+            (lambda () #f) ; getc
+            (lambda () #t)) ; close
+           "w")))
+
 (define %gettext-domain
   ;; Text domain for strings used in the tools.
   "guix")




Acknowledgement sent to Danny Milosavljevic <dannym@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#27566; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 3 Jul 2017 19:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.