unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Ioannis Kappas <ioannis.kappas@gmail.com>, Eli Zaretskii <eliz@gnu.org>
Cc: 46388@debbugs.gnu.org
Subject: bug#46388: 27.1; emacs -batch does not output messages immediately when invoked outside of the command prompt
Date: Sun, 7 Mar 2021 20:05:06 -0800	[thread overview]
Message-ID: <68caa967-89b2-3c35-0d18-ac490a02383a@cs.ucla.edu> (raw)
In-Reply-To: <CAMRHuGBsq2rQG_8zrG5+OsHRwEMbR33xPq9qfq7L27d-9QpTjg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 40 bytes --]

Wouldn't the attached be a simpler fix?

[-- Attachment #2: 0001-On-MS-Windows-fflush-stderr-after-newline.patch --]
[-- Type: text/x-patch, Size: 831 bytes --]

From ff81c979a9528af8065169f83a78de599e99177b Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sun, 7 Mar 2021 20:01:37 -0800
Subject: [PATCH] On MS-Windows, fflush stderr after newline

Problem reported by Ioannis Kappas (Bug#46388).
* src/sysdep.c (errputc) [WINDOWSNT]: Flush stderr after newline.
---
 src/sysdep.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/sysdep.c b/src/sysdep.c
index 941b4e2fa2..88dd3e71e4 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -2662,6 +2662,13 @@ errstream (void)
 errputc (int c)
 {
   fputc_unlocked (c, errstream ());
+
+#ifdef WINDOWSNT
+  /* Flush stderr after outputting a newline since stderr is fully
+     buffered when redirected to a pipe, contrary to POSIX.  */
+  if (c == '\n')
+    fflush_unlocked (stderr);
+#endif
 }
 
 void
-- 
2.29.2


  reply	other threads:[~2021-03-08  4:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08 21:20 bug#46388: 27.1; emacs -batch does not output messages immediately when invoked outside of the command prompt Ioannis Kappas
2021-02-08 21:42 ` Ioannis Kappas
2021-02-09  5:36   ` Eli Zaretskii
2021-02-09 20:15     ` Ioannis Kappas
2021-02-09 20:52       ` Eli Zaretskii
2021-02-09 21:14         ` Eli Zaretskii
     [not found]           ` <CAMRHuGC_p59uw_hmCL65Z0F1ZdFbVAf9MHcB-sX88bW6jchC-Q@mail.gmail.com>
2021-02-10 12:48             ` Ioannis Kappas
2021-02-10 15:57               ` Eli Zaretskii
2021-02-11  8:10                 ` Ioannis Kappas
2021-02-11 14:09                   ` Eli Zaretskii
2021-02-11 19:25                     ` Ioannis Kappas
2021-02-11 19:55                       ` Eli Zaretskii
2021-02-12 19:59                         ` Ioannis Kappas
2021-02-12 20:03                           ` Eli Zaretskii
2021-03-06 15:00                             ` Ioannis Kappas
2021-03-08  4:05                               ` Paul Eggert [this message]
2021-03-08  7:56                                 ` Ioannis Kappas
2021-03-11 14:27                                 ` Eli Zaretskii
2021-03-11 18:43                                   ` Paul Eggert
2021-02-11 21:15                     ` Paul Eggert
2021-02-09  3:38 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=68caa967-89b2-3c35-0d18-ac490a02383a@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=46388@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=ioannis.kappas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).