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

Previous Next

Package: guix-patches;

Reported by: Danny Milosavljevic <dannym <at> scratchpost.org>

Date: Mon, 3 Jul 2017 18:56:02 UTC

Severity: normal

Tags: patch

Done: Danny Milosavljevic <dannym <at> scratchpost.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 27566 in the body.
You can then email your comments to 27566 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#27566; Package guix-patches. (Mon, 03 Jul 2017 18:56:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Danny Milosavljevic <dannym <at> scratchpost.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 03 Jul 2017 18:56:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: guix-patches <at> gnu.org
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>
Subject: [PATCH] ui: spinner-port: New variable.  Export it.
Date: Mon,  3 Jul 2017 20:55:20 +0200
* 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")




Information forwarded to guix-patches <at> gnu.org:
bug#27566; Package guix-patches. (Wed, 26 Jul 2017 08:43:01 GMT) Full text and rfc822 format available.

Message #8 received at 27566 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 27566 <at> debbugs.gnu.org
Subject: Re: [bug#27566] [PATCH] ui: spinner-port: New variable.  Export it.
Date: Wed, 26 Jul 2017 10:42:34 +0200
Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

> * guix/ui.scm (spinner-port): New variable.  Export it.

I’d like to see where we’d use it before committing it.  What would be
the first use?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#27566; Package guix-patches. (Thu, 19 Oct 2017 02:48:01 GMT) Full text and rfc822 format available.

Message #11 received at 27566 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 27566 <at> debbugs.gnu.org
Subject: Re: [bug#27566] [PATCH] ui: spinner-port: New variable.  Export it.
Date: Thu, 19 Oct 2017 00:57:24 +0200
Ludovic Courtès <ludo <at> gnu.org> writes:

> Danny Milosavljevic <dannym <at> scratchpost.org> skribis:
>
>> * guix/ui.scm (spinner-port): New variable.  Export it.
>
> I’d like to see where we’d use it before committing it.  What would be
> the first use?

Ping :)

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net





bug closed, send any further explanations to 27566 <at> debbugs.gnu.org and Danny Milosavljevic <dannym <at> scratchpost.org> Request was from Danny Milosavljevic <dannym <at> scratchpost.org> to control <at> debbugs.gnu.org. (Tue, 22 Jan 2019 14:37:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 20 Feb 2019 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 66 days ago.

Previous Next


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