Re: GUILE_QUIET=1 guile → suppress REPL welcome message (fixed message format)

2024-05-03 Thread Matt Wette

On 3/11/24 6:50 AM, Matt Wette wrote:

On 3/10/24 6:01 PM, Dr. Arne Babenhauserheide wrote:

Hi,

It’s been two months now, did anyone get to review this patch?

It’s small and it gives an instant improvement when using Guile in Emacs
orgmode babel sourceblocks that get evaluated on export.

Best wishes,
Arne

I did look at it.  Another solution, I prefer, is generate a global 
urrent-info-port object and
provide a command-line option to make that a file or /dev/null. Send 
the welcome and

auto-compile messages to (current-info-port).

I had a patch for this at one time, but can't find it right now.


I found it.  Here is a link: 
https://github.com/mwette/guile-contrib/blob/main/patch/3.0.9/info-port.patch


If you type `guile -I` you get desired behavior.    Thinking of changing 
to make the info-port /dev/null by default.


Matt




Re: GUILE_QUIET=1 guile → suppress REPL welcome message (fixed message format)

2024-03-11 Thread Dr. Arne Babenhauserheide
Hi Matt,

Matt Wette  writes:
> On 3/10/24 6:01 PM, Dr. Arne Babenhauserheide wrote:
> It’s small and it gives an instant improvement when using Guile in Emacs
> orgmode babel sourceblocks that get evaluated on export.
>
> I did look at it.  Another solution, I prefer, is generate a global 
> urrent-info-port object and
> provide a command-line option to make that a file or /dev/null.   Send the 
> welcome and 
> auto-compile messages to (current-info-port).

I don’t mind the internal implementation. So I chose the option with the
lowest impact on other parts of Guile.

However I chose to use an environment variable because it makes it
easier to adjust the behavior for special situations without bloating
the interface used by most people.

> I had a patch for this at one time, but can't find it right now.

I’ll gladly review it if you find it again. For such small changes I can
also push.

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de


signature.asc
Description: PGP signature


Re: GUILE_QUIET=1 guile → suppress REPL welcome message (fixed message format)

2024-03-11 Thread Matt Wette

On 3/10/24 6:01 PM, Dr. Arne Babenhauserheide wrote:

Hi,

It’s been two months now, did anyone get to review this patch?

It’s small and it gives an instant improvement when using Guile in Emacs
orgmode babel sourceblocks that get evaluated on export.

Best wishes,
Arne

I did look at it.  Another solution, I prefer, is generate a global 
urrent-info-port object and
provide a command-line option to make that a file or /dev/null. Send the 
welcome and

auto-compile messages to (current-info-port).

I had a patch for this at one time, but can't find it right now.

Matt


Re: GUILE_QUIET=1 guile → suppress REPL welcome message (fixed message format)

2024-03-10 Thread Dr. Arne Babenhauserheide
Hi,

It’s been two months now, did anyone get to review this patch?

It’s small and it gives an instant improvement when using Guile in Emacs
orgmode babel sourceblocks that get evaluated on export.

Best wishes,
Arne

"Dr. Arne Babenhauserheide"  writes:
> Hello,
>
> the following patch makes Guile suppress the repl-welcome message when
> the GUILE_QUIET environment variable is set.
>
> From 5af642cb967942c7cb46b773431a44ceae1e7cbe Mon Sep 17 00:00:00 2001
> From: Arne Babenhauserheide 
> Date: Tue, 9 Jan 2024 14:40:30 +0100
> Subject: [PATCH] GUILE_QUIET: suppress repl-welcome when GUILE_QUIET env is
>  set
>
> * module/system/repl/repl.scm (run-repl*): print welcome *unless* GUILE_QUIET 
> is set
> * doc/ref/guile-invoke.texi (Environment Variables): document GUILE_QUIET
> ---
>  doc/ref/guile-invoke.texi   | 5 +
>  module/system/repl/repl.scm | 3 ++-
>  2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/doc/ref/guile-invoke.texi b/doc/ref/guile-invoke.texi
> index 856bce7b8..2e41d3afb 100644
> --- a/doc/ref/guile-invoke.texi
> +++ b/doc/ref/guile-invoke.texi
> @@ -424,6 +424,11 @@ Guile uses the environment variable @env{HOME}, the name 
> of your home
>  directory, to locate various files, such as @file{.guile} or
>  @file{.guile_history}.
>  
> +@item GUILE_QUIET
> +@vindex GUILE_QUIET
> +The Guile REPL usually shows a startup message. When the environment
> +variable @env{GUILE_QUIET} is set, this message is suppressed.
> +
>  @item GUILE_JIT_THRESHOLD
>  @vindex GUILE_JIT_THRESHOLD
>  Guile has a just-in-time (JIT) code generator that makes running Guile
> diff --git a/module/system/repl/repl.scm b/module/system/repl/repl.scm
> index d83d28759..0fb71ca1c 100644
> --- a/module/system/repl/repl.scm
> +++ b/module/system/repl/repl.scm
> @@ -159,7 +159,8 @@
>(% (with-fluids ((*repl-stack*
>  (cons repl (or (fluid-ref *repl-stack*) '()
> (if (null? (cdr (fluid-ref *repl-stack*)))
> -   (repl-welcome repl))
> +   (unless (getenv "GUILE_QUIET")
> + (repl-welcome repl)))
> (let prompt-loop ()
>   (let ((exp (prompting-meta-read repl)))
> (cond
> -- 
> 2.41.0
>
>
> Best wishes,
> Arne


-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de


signature.asc
Description: PGP signature


Re: GUILE_QUIET=1 guile → suppress REPL welcome message (fixed message format)

2024-01-09 Thread Dr. Arne Babenhauserheide
Sorry for the broken message. Re-sending in mu4e produced strange artifacts.

Here’s a  clean version:
--
Hello,

the following patch makes Guile suppress the repl-welcome message when
the GUILE_QUIET environment variable is set.

From 5af642cb967942c7cb46b773431a44ceae1e7cbe Mon Sep 17 00:00:00 2001
From: Arne Babenhauserheide 
Date: Tue, 9 Jan 2024 14:40:30 +0100
Subject: [PATCH] GUILE_QUIET: suppress repl-welcome when GUILE_QUIET env is
 set

* module/system/repl/repl.scm (run-repl*): print welcome *unless* GUILE_QUIET 
is set
* doc/ref/guile-invoke.texi (Environment Variables): document GUILE_QUIET
---
 doc/ref/guile-invoke.texi   | 5 +
 module/system/repl/repl.scm | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/doc/ref/guile-invoke.texi b/doc/ref/guile-invoke.texi
index 856bce7b8..2e41d3afb 100644
--- a/doc/ref/guile-invoke.texi
+++ b/doc/ref/guile-invoke.texi
@@ -424,6 +424,11 @@ Guile uses the environment variable @env{HOME}, the name 
of your home
 directory, to locate various files, such as @file{.guile} or
 @file{.guile_history}.
 
+@item GUILE_QUIET
+@vindex GUILE_QUIET
+The Guile REPL usually shows a startup message. When the environment
+variable @env{GUILE_QUIET} is set, this message is suppressed.
+
 @item GUILE_JIT_THRESHOLD
 @vindex GUILE_JIT_THRESHOLD
 Guile has a just-in-time (JIT) code generator that makes running Guile
diff --git a/module/system/repl/repl.scm b/module/system/repl/repl.scm
index d83d28759..0fb71ca1c 100644
--- a/module/system/repl/repl.scm
+++ b/module/system/repl/repl.scm
@@ -159,7 +159,8 @@
   (% (with-fluids ((*repl-stack*
 (cons repl (or (fluid-ref *repl-stack*) '()
(if (null? (cdr (fluid-ref *repl-stack*)))
-   (repl-welcome repl))
+   (unless (getenv "GUILE_QUIET")
+ (repl-welcome repl)))
(let prompt-loop ()
  (let ((exp (prompting-meta-read repl)))
(cond
-- 
2.41.0


Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de


signature.asc
Description: PGP signature


GUILE_QUIET=1 guile => suppress REPL welcome message

2024-01-09 Thread Dr. Arne Babenhauserheide
--==-=-=
Content-Type: multipart/mixed; boundary="=-=-="

--=-=-=
Content-Type: text/plain

Hello,

the following patch makes Guile suppress the repl-welcome message when
the GUILE_QUIET environment variable is set.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0001-GUILE_QUIET-suppress-repl-welcome-when-GUILE_QUIET-e.patch
Content-Transfer-Encoding: quoted-printable

From=205af642cb967942c7cb46b773431a44ceae1e7cbe Mon Sep 17 00:00:00 2001
From: Arne Babenhauserheide 
Date: Tue, 9 Jan 2024 14:40:30 +0100
Subject: [PATCH] GUILE_QUIET: suppress repl-welcome when GUILE_QUIET env is
 set

* module/system/repl/repl.scm (run-repl*): print welcome *unless* GUILE_QUI=
ET is set
* doc/ref/guile-invoke.texi (Environment Variables): document GUILE_QUIET
=2D--
 doc/ref/guile-invoke.texi   | 5 +
 module/system/repl/repl.scm | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/doc/ref/guile-invoke.texi b/doc/ref/guile-invoke.texi
index 856bce7b8..2e41d3afb 100644
=2D-- a/doc/ref/guile-invoke.texi
+++ b/doc/ref/guile-invoke.texi
@@ -424,6 +424,11 @@ Guile uses the environment variable @env{HOME}, the na=
me of your home
 directory, to locate various files, such as @file{.guile} or
 @file{.guile_history}.
=20
+@item GUILE_QUIET
+@vindex GUILE_QUIET
+The Guile REPL usually shows a startup message. When the environment
+variable @env{GUILE_QUIET} is set, this message is suppressed.
+
 @item GUILE_JIT_THRESHOLD
 @vindex GUILE_JIT_THRESHOLD
 Guile has a just-in-time (JIT) code generator that makes running Guile
diff --git a/module/system/repl/repl.scm b/module/system/repl/repl.scm
index d83d28759..0fb71ca1c 100644
=2D-- a/module/system/repl/repl.scm
+++ b/module/system/repl/repl.scm
@@ -159,7 +159,8 @@
   (% (with-fluids ((*repl-stack*
 (cons repl (or (fluid-ref *repl-stack*) '()
(if (null? (cdr (fluid-ref *repl-stack*)))
=2D   (repl-welcome repl))
+   (unless (getenv "GUILE_QUIET")
+ (repl-welcome repl)))
(let prompt-loop ()
  (let ((exp (prompting-meta-read repl)))
(cond
=2D-=20
2.41.0


--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable


Best wishes,
Arne
=2D-=20
Unpolitisch sein
hei=C3=9Ft politisch sein,
ohne es zu merken.
draketo.de

--=-=-=--

--==-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-BEGIN PGP SIGNATURE-

iQJEBAEBCAAuFiEE801qEjXQSQPNItXAE++NRSQDw+sFAmWdTiYQHGFybmVfYmFi
QHdlYi5kZQAKCRAT741FJAPD60UZEACrpKiLdZPEptMl9x36l36HRnXDJrJrO/F7
MeF+4x068pguL21qrsweNCpQjJLPI+Y4fgfENHfZMty+aYd2cO0leKpq6zkkBUta
su9gfsVXBUIKDhM1Uw79wCXT86UnrRWbWvtkHy/6gHh8QGNSBp8AtSf8QCYMNCDb
FUmcHdJ9wSIlP9gcM8+d87FcAHstvoJ/Th4dNcDGB/35G/Es9l4S78n+3D51WUXB
fRlr9utvOtsO77i9YQMcFiexVPkh6Am6MMdGDmcsJMg4jCYe9fKrbiKQfPeNgf9u
ZOdqrIqbjFvuQ/dRz4tcV+KqgG/+IV82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