Re: GUILE_QUIET: need help with redirection

<[email protected]>
Newsgroups gmane.lisp.guile.devel
Message-ID <[email protected]>
On Sun, Oct 06, 2024 at 07:13:02AM -0700, Matt Wette wrote:
> Hi All,
> 
> I'm working on an update to guile to output some messages (e.g.,
> auto-compile) to a new
> `current-info-port', which is set to stderr by default.   I also added
> update to output the
> welcome message, ending in "Enter `,help' for help.".   However, this breaks
> the
> `00-repl-server' test which is looking for that message.  The test forks
> guile and closes stderr,
> so it won't see the message ordinarily.   I tried to fix by setting
> `current-info-port' to
> `current-output-port'.   But that does not work.    I now see the welcome
> message printed to
> the screen during the test.   I guess the message is sitting in the stderr
> output buffer before
> the fork happens.   So, options are:
> 1) Leave welcome message as is, going to stdout.
> 2) Find a way to make 00-repl-server.test work.
> 3) Initialize current-info-port to stdout (ugly)
> 4) Add some other hook in system/repl/common.scm(repl-welcome) to deal with
> it (ugly)
> 
> Any ideas?

Hm. Tough question. I think what the test reminds us of is that
your default above (stderr) is a backward-incompatible change,
so I'd be very coutious about that. Who knows whose's code this
might break (besides the test).

So leaving `current-info-port' at stdout as default seems the
safest bet.

Perhaps a command-line option to set `current-info-port' to one
of several useful values (i.e. stderr, but also a void port)
might be helpful.

Cheers
-- 
t
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZwLI+gAKCRAFyCz1etHa
Rs/sAJ9c3ZOA39C936icp3nXHEAAUt4T5wCdErkKIcyP4i+P2PfjoiEjnPfsbbQ=
=XXKa
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.