From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ioannis Kappas Newsgroups: gmane.emacs.bugs Subject: bug#46388: 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 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27662"; mail-complaints-to="usenet@ciao.gmane.io" To: 46388@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 09 00:52:18 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l9GKH-000760-Bt for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Feb 2021 00:52:17 +0100 Original-Received: from localhost ([::1]:59522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9GKG-00037X-Ch for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Feb 2021 18:52:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9Dyt-0002gv-0c for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2021 16:22:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40491) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l9Dys-0005BZ-Lq for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2021 16:22:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l9Dys-0004g9-IB for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2021 16:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ioannis Kappas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Feb 2021 21:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46388 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.161281927217926 (code B ref -1); Mon, 08 Feb 2021 21:22:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Feb 2021 21:21:12 +0000 Original-Received: from localhost ([127.0.0.1]:52037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9Dy3-0004f3-HT for submit@debbugs.gnu.org; Mon, 08 Feb 2021 16:21:11 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:33764) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9Dxx-0004es-Rq for submit@debbugs.gnu.org; Mon, 08 Feb 2021 16:21:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9Dxw-0001Ul-FR for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2021 16:21:04 -0500 Original-Received: from mail-ot1-x334.google.com ([2607:f8b0:4864:20::334]:33840) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l9Dxt-0004kG-Hz for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2021 16:21:04 -0500 Original-Received: by mail-ot1-x334.google.com with SMTP id y11so15588147otq.1 for ; Mon, 08 Feb 2021 13:20:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=1nJFGSGOvcoMKoIwe+VBpx4DDYI4g7XQetIaBigsn5M=; b=bpKP9I22XQyvIAdkEoBI2CmDeG3XPDb30iscC/DDucBha41UJqQqgESkXaKXTsAcOo ScvHZsfyCN3wnTAFw5+o+MlvmAKXBN/QYpt0ubZVaxDM0qJIM6VlYZUeaxg/FF1245J0 VIDAm3tTlt8ZsPOk4IhqTvixhWYLIGdmT8fzfIVrPL7sGEW8Idi7MkqZDv3Sgkgp5xlD YSwgr+VZJ5jozE7chdnaqICKbE1jy5ihRQXjARaytZldhxVHeoUNefu25Jnr9yWxxUyA twNeNxrzUJZKznpERBpDjBVst+OgCTYC+cW2XVOP43spC5hHmKEyczsKJFV8gluGJ4HB Lt4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=1nJFGSGOvcoMKoIwe+VBpx4DDYI4g7XQetIaBigsn5M=; b=XTkSmNChrtH7PngfgGjxGMwoiy+wwtmTpyUmdvRta6bYXjzsGgGdpNSolBCezP1wDB Gdvy9ZdkV+Az/F0J9HeZfl7dY0XhNzZrRrCo0k73gt0Gn1XAOCHI3Pbt/4kUEgV0DIpA Ybwrl7I8DAuC7ospiae4Q9+MIDFLRMTteJuxc4n6jfP3gy64VAg2EMH6gtGqgdpBZ3j7 6IenJD/GEFta9UqpacZfP1wNM+5GPoGFp60iVWJY1Qjhqv++RhJF7oW7DoeSXvM4hEUB 9nIxlySuMFq0A7Jhdc70obMMdYV8tcdzCfNSFSBHsnxm8Fxln7llBu16nzG1pt/hkMkz 13/g== X-Gm-Message-State: AOAM531N66xz0wvKiCah/ODrjHlaQ3lQNavCi/VsTerbLDkqQW8GEitw M4/1pNXK5xtq0P9XjPMvzDyC7q2wgINcPkyg5eanjshYp6akJQ== X-Google-Smtp-Source: ABdhPJwcrSCRhFvb6x4FjjxXLyAxHx3ZTaUnK/ueqRUenKq7KOnqh7TTPHe7+0emewB3/AAAkzZDunb0PAvAqaVHP8Y= X-Received: by 2002:a9d:3b26:: with SMTP id z35mr13613555otb.192.1612819256991; Mon, 08 Feb 2021 13:20:56 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::334; envelope-from=ioannis.kappas@gmail.com; helo=mail-ot1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:199641 Archived-At: 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