GNU bug report logs - #46388
27.1; emacs -batch does not output messages immediately when invoked outside of the command prompt

Previous Next

Package: emacs;

Reported by: Ioannis Kappas <ioannis.kappas <at> gmail.com>

Date: Mon, 8 Feb 2021 21:22:02 UTC

Severity: normal

Found in version 27.1

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ioannis Kappas <ioannis.kappas <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.1; emacs -batch does not output messages immediately when invoked
 outside of the command prompt
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.

    Here is a small summary running the above under Linux and windows
    native:

    | system              | invoked from   | terminal output
                 |
    |---------------------+----------------+--------------------------------------------|
    | x86_64-pc-linux-gnu | terminal       | prints "hi", then after 5
seconds it exits |
    | x86_64-pc-linux-gnu | emacs eshell   | prints "hi", then after 5
seconds it exits |
    | x86_64-w64-mingw32  | command prompt | prints "hi", then after 5
seconds it exits |
    | x86_64-w64-mingw32  | emacs eshell   | after 5 seconds prints
"hi", then exits    |

    The issue on windows is not exclusive to invoking emacs -batch
    from within emacs (e.g. from eshell), it applies to any invocation
that happens
    outside the command prompt, e.g. from inside the MSYS2 mintty
    terminal.

    It appears as if the issue is caused by a different stderr
    buffering mode used when a program is invoked outside of
    the command prompt. Analysis to follow.

In GNU Emacs 27.1 (build 1, x86_64-w64-mingw32)
 of 2020-11-19 built on fv-az68-340
Repository revision: ec297125a76481c55390d0b329e541907879d6f3
Repository branch: master
Windowing system distributor 'Microsoft Corp.', version 10




This bug report was last modified 4 years and 69 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.