From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sahitihi Subject: Re: Status of Submitted Patches Date: Wed, 23 May 2018 13:23:50 +0530 Message-ID: <149bfb8c-22b5-797d-e88a-ca4077b0a4cc@swecha.net> References: <8ea5d026-fab9-7b12-198e-610ad7743cb2@swecha.net> <871sfxev9w.fsf@elephly.net> <7626275c-3eee-bb05-ab9d-4c88ec6f0329@swecha.net> <87r2nvjte6.fsf@elephly.net> <5ab51417-b635-9725-9f48-3bc3f9b61fdf@swecha.net> <87tvsko2wd.fsf@elephly.net> <7290013c-990d-3f7d-d8db-38e090ed766a@swecha.net> <87zi28kt82.fsf@elephly.net> <8573e97d-d107-cde6-cd17-35f4ef6d2de3@swecha.net> <87k1takumm.fsf@elephly.net> <87o9hycwl6.fsf@elephly.net> <87r2mhdeap.fsf@elephly.net> <618c131c-6ba6-e525-aefc-72acca1c910f@swecha.net> <87a7suwtp7.fsf@elephly.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------80A5186C351ABE44F0196392" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:32799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLOba-0005HF-Cd for guix-devel@gnu.org; Wed, 23 May 2018 03:54:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLObV-0004qT-I6 for guix-devel@gnu.org; Wed, 23 May 2018 03:54:42 -0400 In-Reply-To: <87a7suwtp7.fsf@elephly.net> Content-Language: en-US List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ricardo Wurmus Cc: guix-devel@gnu.org This is a multi-part message in MIME format. --------------80A5186C351ABE44F0196392 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Ricardo, > As a first change, could you please add the relevant parts of =E2=80=9C= (ice-9 > colorized)=E2=80=9D to a module in Guix? We probably don=E2=80=99t wan= t to depend on > having users install this module separately. We also don=E2=80=99t nee= d all of > it. Please prepare a patch that adds only the relevant parts to =E2=80= =9C(guix > ui)=E2=80=9D and update the copyright headers. I think small changes to the attached file will serve the purpose. But when I tried executing the file, that resulted with a error unbound v= ariable : colorize string=20 I am not sure where I went wrong, can you please explain. --Sahithi --------------80A5186C351ABE44F0196392 Content-Type: text/x-scheme; name="escape.scm" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="escape.scm" (display (colorize-string "Hello!\n" 'RED 'BOLD 'ON-BLUE)) (for-each display (list (color 'RED 'BOLD 'ON-BLUE) "Hello!" (color 'RESET))) (define-module (term ansi-color) #:export (color colorize-string) #:use-module (srfi srfi-1) ; for 'remove' #:use-module (srfi srfi-13)) ; for 'string-join'=20 (define ansi-color-tables (let ((table (make-hash-table 23))) (hashq-set! table 'CLEAR "0") (hashq-set! table 'RESET "0") (hashq-set! table 'BOLD "1") (hashq-set! table 'DARK "2") (hashq-set! table 'UNDERLINE "4") (hashq-set! table 'UNDERSCORE "4") (hashq-set! table 'BLINK "5") (hashq-set! table 'REVERSE "6") (hashq-set! table 'CONCEALED "8") (hashq-set! table 'BLACK "30") (hashq-set! table 'RED "31") (hashq-set! table 'GREEN "32") (hashq-set! table 'YELLOW "33") (hashq-set! table 'BLUE "34") (hashq-set! table 'MAGENTA "35") (hashq-set! table 'CYAN "36") (hashq-set! table 'WHITE "37") (hashq-set! table 'ON-BLACK "40") (hashq-set! table 'ON-RED "41") (hashq-set! table 'ON-GREEN "42") (hashq-set! table 'ON-YELLOW "43") (hashq-set! table 'ON-BLUE "44") (hashq-set! table 'ON-MAGENTA "45") (hashq-set! table 'ON-CYAN "46") (hashq-set! table 'ON-WHITE "47") table)) (define (color . lst) (let ((color-list=20 (remove not=20 (map (lambda (color) (hashq-ref ansi-color-tables color)= ) lst)))) (if (null? color-list) "" (string-append=20 (string #\esc #\[) (string-join color-list ";" 'infix) "m")))) =20 (define (colorize-string str . color-list) (string-append (apply color color-list) str (color 'RESET))) --------------80A5186C351ABE44F0196392--