emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `message' not outputting the newline "atomically"


From: Eli Zaretskii
Subject: Re: `message' not outputting the newline "atomically"
Date: Tue, 09 Jul 2019 21:32:34 +0300

> Cc: address@hidden, address@hidden, address@hidden
> From: Paul Eggert <address@hidden>
> Date: Tue, 9 Jul 2019 11:12:52 -0700
> 
> Eli Zaretskii wrote:
> > We already found an agreed solution for
> > 'message' and 'vmessage', so why step back and re-introduce them into
> > the problem again?
> 
> Because we now have a simpler solution.

I don't think it's simpler: it causes 'message' write to a different
file descriptor, and thus introduces a backward incompatibility.

> > As for other messages, I think the vast majority are diagnostics, and
> > thus using stdout for them is inappropriate, as it will get in the way
> > of using Emacs in scripts.
> 
> No, Emacs uses stdout reasonably extensively for this sort of thing already; 
> see 
> 'write_stdout' and I can cite several other examples.

write_stdout is used in exactly 10 places, which I wouldn't call
"extensive".  It is used where AFAIU any other file descriptor would
be problematic.  So I don't think I see how this argument should
convince me.

> In practice this has not 
> been a problem because nobody cares whether these kinds of Emacs messages go 
> to 
> stdout or stderr.

I don't understand how could you make these assertions.  What are they
based on?

I believe it is a convention to output diagnostic messages about
abnormal or unexpected events to stderr, not stdout.  Why should Emacs
deviate from this convention?

> > what would happen if a script says
> > 2>foo? will the file 'foo' remain empty if we use any stream but
> > stderr inside message_to_stderr?
> 
> No, it'll work fine. The OS doesn't care about stdio's buffers; all it cares 
> is 
> whether file descriptor 2 is used, which it is.

Oh, I've misremembered that they use the same descriptor, sorry.

So I think your previous proposal for message_to_stderr and vmessage
should be okay to go in.  But not the rest, sorry.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]