bug#78151: [patch] GUILE_QUIET env to silence diagnostic compile messages and welcome message

"Dr. Arne Babenhauserheide" via "Bug reports for GUILE, GNU's Ubiquitous Extension Language" <[email protected]> Tue, 29 Apr 2025 23:04:38 +0200
Newsgroups gmane.lisp.guile.bugs
Message-ID <[email protected]>
Hi,

I’ve been using the GUILE_QUIET change that extends bug 73685¹ for
almost a year now and it helps me a lot with exporting from org-mode, so
I’d really like to see it merged.

> Matt Wette <[email protected]> writes:
>> users the ability to silence compile and loading messages that occur

The GUILE_QUIET patch now uses your mechanism. It’s just a way to toggle
it with an environment variable (that I can set in a specific Emacs
instance) instead of for the whole user.

Also included is an entry for the NEWS file to mention the -I switch.


Are these two patches OK to merge?

I can push it myself, but I need a review.

Best wishes,
Arne

¹ https://lists.gnu.org/archive/html/guile-devel/2024-10/msg00023.html
0001-GUILE_QUIET-suppress-repl-welcome-when-GUILE_QUIET-e.patch (text/x-patch, 1.8 KB)
From 70e630eafdabc39b55593feff768ec113c9704de Mon Sep 17 00:00:00 2001
From: Arne Babenhauserheide <[email protected]>
Date: Sat, 13 Jul 2024 11:37:03 +0200
Subject: [PATCH 1/2] 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 7ceef0bb5..7f7662e20 100644
--- a/doc/ref/guile-invoke.texi
+++ b/doc/ref/guile-invoke.texi
@@ -428,6 +428,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 1c3407159..9215306a3 100644
--- a/module/system/repl/repl.scm
+++ b/module/system/repl/repl.scm
@@ -157,7 +157,8 @@
   (% (with-fluids ((*repl-stack*
                     (cons repl (or (fluid-ref *repl-stack*) '()))))
        (if (and (null? (cdr (fluid-ref *repl-stack*)))
-                (not (%inhibit-welcome-message)))
+                (not (%inhibit-welcome-message))
+                (not (getenv "GUILE_QUIET")))
            (repl-welcome repl))
        (let prompt-loop ()
          (let ((exp (prompting-meta-read repl)))
-- 
2.49.0
0002-note-guile-I-in-the-NEWS-file.patch (text/x-patch, 899 B)
From d4bab6136f743eef7633f3d336da8d5821e04bcc Mon Sep 17 00:00:00 2001
From: Arne Babenhauserheide <[email protected]>
Date: Sat, 12 Oct 2024 14:29:03 +0200
Subject: [PATCH 2/2] note guile -I in the NEWS file

---
 NEWS | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/NEWS b/NEWS
index b4a705231..5e2714ef7 100644
--- a/NEWS
+++ b/NEWS
@@ -45,6 +45,12 @@ for-delimited-from-port and for-line-in-file. Of these, for-line-in-file
 is helpful in the common situation where you want a procedure applied to
 every line in a file.
 
+** -I commandline flag to silence diagnostic messages
+
+When guile is started with the -I flag, it will not report diagnostic
+messages (e.g., from compiling source files). This sets
+=current-info-port= to a void-port.
+
 ** Improve 'load-foreign-library' handling of DLLs
 
 The non-libltdl load-foreign-library introduced in 3.0.6 does not handle
-- 
2.49.0
signature.asc (application/pgp-signature, 1.1 KB)
-----BEGIN PGP SIGNATURE-----

iQJEBAEBCAAuFiEE801qEjXQSQPNItXAE++NRSQDw+sFAmgRPuYQHGFybmVfYmFi
QHdlYi5kZQAKCRAT741FJAPD69KeEADQ9SWk7i7fJpfVH4i6l4F9CO3Zw0hTKZf8
6zHa7IbwxblYaVvUZVaiQxJRjqg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