unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* GUILE_QUIET=1 guile => suppress REPL welcome message
@ 2024-01-09 13:43 Dr. Arne Babenhauserheide
  2024-01-09 15:50 ` GUILE_QUIET=1 guile → suppress REPL welcome message (fixed message format) Dr. Arne Babenhauserheide
  0 siblings, 1 reply; 5+ messages in thread
From: Dr. Arne Babenhauserheide @ 2024-01-09 13:43 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 3577 bytes --]

--==-=-=
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 <arne_bab@web.de>
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/+IV82sWdoYZeTVEDKqKkp/UPLreCjqVnqzNPf
71hTf6jO7sWn8JTCHQhZ5myPScGpcWx2/zg1J7DTC1yKNh1NhCljJWM7H4A0X6VG
iG0r3IIiu/XYjX3ezjXmTT05v3GAD+cpV+Z563Oycrb6c9qalzyTssJTFsQJLPWK
4X3MXjiHktDUaI8SKkWUtu1GpvaxKwSMxWC8kVKJhRh/D0Bk9rounkfIOlkS54ll
eIiIQCsd1FchiI/YunC/JebbrNROyIpaBSvRX0YSzsPXCNZfw7pOR4x1uicpb1pW
cBZhpmJTDLfL/vEDoqXhEm6UVVxJZqhWTxhgkuZDhXP58t43hmNiNPK1WjQE1if6
BBkUjvmhyojEBAEBCAAuFiEE3Si95tmHXKvOSosd3M8NswvBBUgFAmWdTiYQHGFy
bmVfYmFiQHdlYi5kZQAKCRDczw2zC8EFSJWGA/4k6a5j5fL6Llf5/pU4hglzvZn4
uZhARZpEO0G8VknicwXXu0hhnikpjdZb34j2gD9BnWctrCU5FLFnnxWooPHT/ND4
wbhxHrXMuBXTbkSPkFDXm8nuWMJMce/w1SSQgmW5zLiOx22mrT4q00XlvaQMKoG2
XdvzcrxsTdUqufIGWw==
=CbA+
-----END PGP SIGNATURE-----
--==-=-=--

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GUILE_QUIET=1 guile → suppress REPL welcome message (fixed message format)
  2024-01-09 13:43 GUILE_QUIET=1 guile => suppress REPL welcome message Dr. Arne Babenhauserheide
@ 2024-01-09 15:50 ` Dr. Arne Babenhauserheide
  2024-03-11  1:01   ` Dr. Arne Babenhauserheide
  0 siblings, 1 reply; 5+ messages in thread
From: Dr. Arne Babenhauserheide @ 2024-01-09 15:50 UTC (permalink / raw)
  To: guile-devel; +Cc: Dr. Arne Babenhauserheide

[-- Attachment #1: Type: text/plain, Size: 2133 bytes --]

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 <arne_bab@web.de>
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: GUILE_QUIET=1 guile → suppress REPL welcome message (fixed message format)
  2024-01-09 15:50 ` GUILE_QUIET=1 guile → suppress REPL welcome message (fixed message format) Dr. Arne Babenhauserheide
@ 2024-03-11  1:01   ` Dr. Arne Babenhauserheide
  2024-03-11 13:50     ` Matt Wette
  0 siblings, 1 reply; 5+ messages in thread
From: Dr. Arne Babenhauserheide @ 2024-03-11  1:01 UTC (permalink / raw)
  To: Dr. Arne Babenhauserheide; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 2411 bytes --]

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" <arne_bab@web.de> 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 <arne_bab@web.de>
> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GUILE_QUIET=1 guile → suppress REPL welcome message (fixed message format)
  2024-03-11  1:01   ` Dr. Arne Babenhauserheide
@ 2024-03-11 13:50     ` Matt Wette
  2024-03-11 19:41       ` Dr. Arne Babenhauserheide
  0 siblings, 1 reply; 5+ messages in thread
From: Matt Wette @ 2024-03-11 13:50 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 594 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 931 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GUILE_QUIET=1 guile → suppress REPL welcome message (fixed message format)
  2024-03-11 13:50     ` Matt Wette
@ 2024-03-11 19:41       ` Dr. Arne Babenhauserheide
  0 siblings, 0 replies; 5+ messages in thread
From: Dr. Arne Babenhauserheide @ 2024-03-11 19:41 UTC (permalink / raw)
  To: Matt Wette; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 1047 bytes --]

Hi Matt,

Matt Wette <matt.wette@gmail.com> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-11 19:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-09 13:43 GUILE_QUIET=1 guile => suppress REPL welcome message Dr. Arne Babenhauserheide
2024-01-09 15:50 ` GUILE_QUIET=1 guile → suppress REPL welcome message (fixed message format) Dr. Arne Babenhauserheide
2024-03-11  1:01   ` Dr. Arne Babenhauserheide
2024-03-11 13:50     ` Matt Wette
2024-03-11 19:41       ` Dr. Arne Babenhauserheide

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).