From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTCCH-0007z7-2a for guix-patches@gnu.org; Sat, 01 Dec 2018 15:49:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gTCCD-0004Ql-VJ for guix-patches@gnu.org; Sat, 01 Dec 2018 15:49:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:53059) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gTCCD-0004QQ-QY for guix-patches@gnu.org; Sat, 01 Dec 2018 15:49:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gTCCD-00071B-Lz for guix-patches@gnu.org; Sat, 01 Dec 2018 15:49:01 -0500 Subject: [bug#33466] [PATCH 2/2] repl: Add 'colorized' and 'readline' support. Resent-Message-ID: From: Oleg Pykhalov References: <20181122144228.31573-1-go.wigust@gmail.com> <20181122144228.31573-2-go.wigust@gmail.com> <874lc4vqjx.fsf@gnu.org> Date: Sat, 01 Dec 2018 23:48:02 +0300 In-Reply-To: <874lc4vqjx.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sun, 25 Nov 2018 21:40:50 +0100") Message-ID: <871s71rn25.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 33466@debbugs.gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Ludovic. Apologies for a delay. ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Oleg Pykhalov skribis: > >> * guix/scripts/repl.scm (guix-repl): Add 'colorized' and 'readline' supp= ort. >> --- >> guix/scripts/repl.scm | 17 +++++++++++++++++ >> 1 file changed, 17 insertions(+) >> >> diff --git a/guix/scripts/repl.scm b/guix/scripts/repl.scm >> index 1a105f51e..eeaf4acc4 100644 >> --- a/guix/scripts/repl.scm >> +++ b/guix/scripts/repl.scm >> @@ -188,6 +188,23 @@ call THUNK." >> (save-module-excursion >> (lambda () >> (set-current-module user-module) >> + (cond ((false-if-exception (resolve-interface '(ice-9 r= eadline))) >> + =3D> >> + (lambda (module) >> + ;; Enable completion and input history at the = REPL. >> + ((module-ref module 'activate-readline)))) > > What about simply loading ~/.guile when it exists? Oh, sure. I should thought about this way. The patch is attached below. <#secure method=3Dpgpmime mode=3Dsign> --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-repl-Load-user-s-initialization-file.patch Content-Transfer-Encoding: quoted-printable Content-Description: [PATCH] repl: Load user's initialization file. From=2095b95b24107084baf03e9635280a8c3136b2a356 Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Thu, 22 Nov 2018 17:24:04 +0300 Subject: [PATCH] repl: Load user's initialization file. * guix/scripts/repl.scm (guix-repl): Load user's initialization file. =2D-- guix/scripts/repl.scm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/guix/scripts/repl.scm b/guix/scripts/repl.scm index 1a105f51ee..b688867b15 100644 =2D-- a/guix/scripts/repl.scm +++ b/guix/scripts/repl.scm @@ -68,6 +68,9 @@ Start a Guile REPL in the Guix execution environment.\n")) (newline) (show-bug-report-information)) =20 +(define %guile-initialization-file + (string-append (getenv "HOME") "/.guile")) + (define (self-quoting? x) "Return #t if X is self-quoting." (letrec-syntax ((one-of (syntax-rules () @@ -188,6 +191,8 @@ call THUNK." (save-module-excursion (lambda () (set-current-module user-module) + (when (file-exists? %guile-initialization-file) + (load %guile-initialization-file)) ;; Do not exit repl on SIGINT. ((@@ (ice-9 top-repl) call-with-sigint) (lambda () =2D-=20 2.19.1 --=-=-= Content-Type: text/plain Thanks, Oleg. --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAlwC84IACgkQFn+OpQAa +pxR6w/+JiP9NwnreOsHG8mXtMIcUk/0G2dhixcN96vVCBIMbo2T9+xAyrsRB1zb G6wu2rJgI5XZkyZy8JL39Di2jUgu4aWE/vgh1DtJ5s5XOoE5c9bnjTQAM8fxcB0U zDWN+cL4Ic2BGboUxH4RNTGfOuJ7w/YQdmLY2ih/uCrXP1dzx1PCJ4oFanAHsNIv 8nSBcAIqQLG0jG9sX7ustGNR58tlqTbXyP6hnyvM/He/8w4a2M0W3xR6pOlZnC3g UYvAu9fAdjRniZm+QzPCgCUxFFby3JoSBZwHw+iPD2n9GBtAYuWl3d6mJNE0KfgB jIPkl5ZbdjCtw/GOLKpBDp6n4Wc6EzMW4i2L3IiHt4RCnv3RKrsTLs/rRRuWJAIC UM5ASq4tVLq0n4JPhn/w33DbiBFcmKF7BA/yiCw7J67gB0/5EW5IRyiUNY/hbU1o FewKZl0vVFDBbaTjQq5zR4qycfvVhcghnuQDx++u8W4efWABUXONxoX+NPdikY4o 01MKEbNP51LXVjAWgZqWvMABvhbl31XI+Uz97YfZlvt5KNyYIKzRJj6GjbkSVyEk F3mIix+fbNtmC771DaK9Y1snIg30vMuHVn6g6/9+BE0ru8R4jM2wwzBnKwnyFoLD E68S5aQIptR/XQwBsTlI7jZGuq6hjlOPJfo/OXH+tx0avUrbXQI= =eE6I -----END PGP SIGNATURE----- --==-=-=--