bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#46388: 27.1; emacs -batch does not output messages immediately when


From: Paul Eggert
Subject: bug#46388: 27.1; emacs -batch does not output messages immediately when invoked outside of the command prompt
Date: Thu, 11 Feb 2021 13:15:42 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1

On 2/11/21 6:09 AM, Eli Zaretskii wrote:
Then maybe this:

/* Return the error output stream.  */
static FILE *
errstream (void)
{
   FILE *err = buferr;
   if (!err)
     return stderr;
   fflush_unlocked (stderr);  <<<<<<<<<<<<<<<<
   return err;
}
should be fixed to fflush 'buferr' instead (or in addition to stderr)?

Paul, isn't that a bug that we fflush stderr here, and not 'buferr'?

No, it's intended. The goal of 'errstream' is to flush out all the stuff written to stderr, before outputting anything sent to buferr. There is no need to fflush buferr here, since it's gonna be flushed soon anyway when a newline is output.

Functions like message_to_stderr etc. are supposed to do a series of calls to one or more functions like errwrite that end with outputting a newline, without invoking any code that outputs directly to stderr. This is explained in the comment before sysdep.c's errputc function, a comment that could perhaps be improved.





reply via email to

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