Subject: Re: bug#46388: 27.1; emacs -batch does not output messages immediately when invoked outside of the command prompt

From: Eli Zaretskii <[email-masked]>
Date: Tue, 09 Feb 2021 05:38:46 +0200

> From: Ioannis Kappas <[email-masked]>
> Date: Mon, 8 Feb 2021 21:20:47 +0000
> 
>     There appears to be an issue with the /message/ function when
>     emacs is invoked in -batch mode on windows-nt from outside the
>     windows console (i.e. not directly from the command
>     prompt). Messages are not displayed to the user until emacs exits.
> 
>     Consider the following command from example, which suppose to
>     print the message "hi" first to the user and then exit after 5 seconds:
> 
>     : emacs -Q --batch --eval="(progn (message \"hi\") (sit-for 5))"
> 
>     When this command is invoked from within an emacs eshell on
>     windows, the message is only displayed to the user after about 5 seconds,
>     i.e when emacs is about to exit.

I believe this is because of buffering: Eshell on MS-Windows invokes
subprograms via pipes, which are buffered.