GNU bug report logs - #78151
[patch] GUILE_QUIET env to silence diagnostic compile messages and welcome message

Previous Next

Package: guile;

Reported by: "Dr. Arne Babenhauserheide" <arne_bab <at> web.de>

Date: Tue, 29 Apr 2025 21:05:04 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 78151 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#78151; Package guile. (Tue, 29 Apr 2025 21:05:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Dr. Arne Babenhauserheide" <arne_bab <at> web.de>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Tue, 29 Apr 2025 21:05:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Dr. Arne Babenhauserheide" <arne_bab <at> web.de>
To: bug-guile <at> gnu.org
Subject: [patch] GUILE_QUIET env to silence diagnostic compile messages and
 welcome message
Date: Tue, 29 Apr 2025 23:04:38 +0200
[Message part 1 (text/plain, inline)]
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 <matt.wette <at> gmail.com> 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.

[0001-GUILE_QUIET-suppress-repl-welcome-when-GUILE_QUIET-e.patch (text/x-patch, inline)]
From 70e630eafdabc39b55593feff768ec113c9704de Mon Sep 17 00:00:00 2001
From: Arne Babenhauserheide <arne_bab <at> web.de>
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, inline)]
From d4bab6136f743eef7633f3d336da8d5821e04bcc Mon Sep 17 00:00:00 2001
From: Arne Babenhauserheide <arne_bab <at> web.de>
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

[Message part 4 (text/plain, inline)]
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
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 3 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.