GNU bug report logs - #28166
25.2; Batch mode not perfectly noninteractive

Previous Next

Package: emacs;

Reported by: Андрей Парамонов <cmr.pent <at> gmail.com>

Date: Sun, 20 Aug 2017 19:54:02 UTC

Severity: normal

Tags: notabug

Found in version 25.2

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28166 in the body.
You can then email your comments to 28166 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#28166; Package emacs. (Sun, 20 Aug 2017 19:54:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Андрей Парамонов <cmr.pent <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 20 Aug 2017 19:54:02 GMT) Full text and rfc822 format available.

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

From: Андрей Парамонов
 <cmr.pent <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.2; Batch mode not perfectly noninteractive
Date: Sun, 20 Aug 2017 22:52:32 +0300
[Message part 1 (text/plain, inline)]
According to
https://www.gnu.org/software/emacs/manual/html_node/elisp/Batch-Mode.html
in noninteractive mode, Emacs does not read commands from the terminal.

However,
$cat test.el
(princ noninteractive)
(princ (read-string ""))

$C:\emacs\bin\emacs.exe --script test.el
t
[waiting for user input]

Calling
$C:\emacs\bin\emacs.exe --script test.el < test.el
- or -
$C:\emacs\bin\emacs.exe --script test.el < NUL
works as expected (script finishes without user-input ^D).

Emacs should never wait for interactive user input in batch mode.

I'm ready to provide any additional info,
Andrey Paramonov
---

In GNU Emacs 25.2.1 (x86_64-w64-mingw32)
 of 2017-04-24 built on LAPHROAIG
Windowing system distributor 'Microsoft Corp.', version 6.3.9600
Configured using:
 'configure --without-dbus --without-compress-install 'CFLAGS=-O2
 -static -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS

Important settings:
  value of $LANG: RUS
  locale-coding-system: cp1252

Features:
(shadow sort mail-extr emacsbug message idna dired format-spec rfc822
mml mml-sec password-cache epg gnus-util mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils cus-start
cus-load paren finder-inf info tex-site package epg-config seq byte-opt
gv bytecomp byte-compile cl-extra help-mode easymenu cconv cl-loaddefs
pcase cl-lib time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp disp-table
w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote w32notify w32 multi-tty
make-network-process emacs)
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28166; Package emacs. (Sun, 20 Aug 2017 20:12:01 GMT) Full text and rfc822 format available.

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

From: npostavs <at> users.sourceforge.net
To: Андрей Парамонов
 <cmr.pent <at> gmail.com>
Cc: 28166 <at> debbugs.gnu.org
Subject: Re: bug#28166: 25.2; Batch mode not perfectly noninteractive
Date: Sun, 20 Aug 2017 16:13:07 -0400
tags 28166 notabug
quit

Андрей Парамонов <cmr.pent <at> gmail.com> writes:

> According to
> https://www.gnu.org/software/emacs/manual/html_node/elisp/Batch-Mode.html
> in noninteractive mode, Emacs does not read commands from the terminal.

That page says:

    [...] input that would normally come from the minibuffer is read
    from the standard input descriptor.

> $cat test.el
> (princ noninteractive)
> (princ (read-string ""))
>
> $C:\emacs\bin\emacs.exe --script test.el
> t
> [waiting for user input]
>
> Calling
> $C:\emacs\bin\emacs.exe --script test.el < test.el
> - or -
> $C:\emacs\bin\emacs.exe --script test.el < NUL
> works as expected (script finishes without user-input ^D).

So it looks to me that everything is working as expected.





Added tag(s) notabug. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sun, 20 Aug 2017 20:12:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28166; Package emacs. (Mon, 21 Aug 2017 01:16:01 GMT) Full text and rfc822 format available.

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

From: Андрей Парамонов
 <cmr.pent <at> gmail.com>
To: npostavs <at> users.sourceforge.net
Cc: 28166 <at> debbugs.gnu.org
Subject: Re: bug#28166: 25.2; Batch mode not perfectly noninteractive
Date: Mon, 21 Aug 2017 04:15:06 +0300
[Message part 1 (text/plain, inline)]
I think the logical behavior for
$C:\emacs\bin\emacs.exe --script test.el
would be the same as for
$C:\emacs\bin\emacs.exe --script test.el < NUL

Currently,
$C:\emacs\bin\emacs.exe --script test.el
is still interactive -- the process doesn't finish unless user inputs ^D
interactively.

Best wishes,
Andrey Paramonov
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28166; Package emacs. (Mon, 21 Aug 2017 02:32:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Андрей Парамонов
 <cmr.pent <at> gmail.com>
Cc: 28166 <at> debbugs.gnu.org, npostavs <at> users.sourceforge.net
Subject: Re: bug#28166: 25.2; Batch mode not perfectly noninteractive
Date: Mon, 21 Aug 2017 05:30:51 +0300
> From: Андрей Парамонов
> 	<cmr.pent <at> gmail.com>
> Date: Mon, 21 Aug 2017 04:15:06 +0300
> Cc: 28166 <at> debbugs.gnu.org
> 
> I think the logical behavior for
> $C:\emacs\bin\emacs.exe --script test.el
> would be the same as for
> $C:\emacs\bin\emacs.exe --script test.el < NUL

Why?  Shell scripts can read input from the keyboard, can't they?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28166; Package emacs. (Mon, 21 Aug 2017 02:44:01 GMT) Full text and rfc822 format available.

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

From: Андрей Парамонов
 <cmr.pent <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 28166 <at> debbugs.gnu.org, npostavs <at> users.sourceforge.net
Subject: Re: bug#28166: 25.2; Batch mode not perfectly noninteractive
Date: Mon, 21 Aug 2017 05:42:39 +0300
[Message part 1 (text/plain, inline)]
2017-08-21 5:30 GMT+03:00 Eli Zaretskii <eliz <at> gnu.org>:

> > From: Андрей Парамонов
> >       <cmr.pent <at> gmail.com>
> > Date: Mon, 21 Aug 2017 04:15:06 +0300
> > Cc: 28166 <at> debbugs.gnu.org
> >
> > I think the logical behavior for
> > $C:\emacs\bin\emacs.exe --script test.el
> > would be the same as for
> > $C:\emacs\bin\emacs.exe --script test.el < NUL
>
> Why?  Shell scripts can read input from the keyboard, can't they?
>

I thought that "noninteractive" means precisely:
do not read from keyboard.

However I'm not sure now. How do other (e.g Lisp) interpreters behave in
similar circumstances?

Best wishes,
Andrey Paramonov
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28166; Package emacs. (Mon, 21 Aug 2017 03:27:02 GMT) Full text and rfc822 format available.

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

From: npostavs <at> users.sourceforge.net
To: Андрей Парамонов
 <cmr.pent <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 28166 <at> debbugs.gnu.org
Subject: Re: bug#28166: 25.2; Batch mode not perfectly noninteractive
Date: Sun, 20 Aug 2017 23:28:21 -0400
Андрей Парамонов <cmr.pent <at> gmail.com> writes:

> I thought that "noninteractive" means precisely:
> do not read from keyboard.
>
> However I'm not sure now. How do other (e.g Lisp) interpreters behave
> in similar circumstances?

sbcl has a --non-interactive option, it doesn't disable reading from
stdin.  It basically just prevents the REPL from starting.  I think this
is analogous to Emacs' --batch/--script option preventing the command
loop from starting.

    ~/tmp$ cat read-line.lisp 
    (read-line)
    ~/tmp$ sbcl --script read-line.lisp --non-interactive
    [waiting for input here...]
    ~/tmp$ sbcl --help
    Usage: sbcl [runtime-options] [toplevel-options] [user-options]
      [...]
      --disable-debugger         Invoke sb-ext:disable-debugger.
      --noprint                  Run a Read-Eval Loop without printing results.
      --script [<filename>]      Skip #! line, disable debugger, avoid verbosity.
      --quit                     Exit with code 0 after option processing.
      --non-interactive          Sets both --quit and --disable-debugger.
      [...]




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28166; Package emacs. (Mon, 21 Aug 2017 07:50:01 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> suse.de>
To: Андрей Парамонов
 <cmr.pent <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 28166 <at> debbugs.gnu.org,
 npostavs <at> users.sourceforge.net
Subject: Re: bug#28166: 25.2; Batch mode not perfectly noninteractive
Date: Mon, 21 Aug 2017 09:49:11 +0200
On Aug 21 2017, Андрей Парамонов <cmr.pent <at> gmail.com> wrote:

> I thought that "noninteractive" means precisely:
> do not read from keyboard.

It means "don't take over the terminal".

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28166; Package emacs. (Mon, 21 Aug 2017 07:54:02 GMT) Full text and rfc822 format available.

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

From: Андрей Парамонов
 <cmr.pent <at> gmail.com>
To: Andreas Schwab <schwab <at> suse.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 28166 <at> debbugs.gnu.org,
 npostavs <at> users.sourceforge.net
Subject: Re: bug#28166: 25.2; Batch mode not perfectly noninteractive
Date: Mon, 21 Aug 2017 10:52:52 +0300
[Message part 1 (text/plain, inline)]
Upon reconsideration I now agree that this is not a bug.
Sorry for the noise,
Andrey Paramonov
[Message part 2 (text/html, inline)]

bug closed, send any further explanations to 28166 <at> debbugs.gnu.org and Андрей Парамонов <cmr.pent <at> gmail.com> Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Mon, 21 Aug 2017 11:38:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28166; Package emacs. (Mon, 21 Aug 2017 14:19:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Андрей Парамонов
 <cmr.pent <at> gmail.com>
Cc: schwab <at> suse.de, 28166 <at> debbugs.gnu.org, npostavs <at> users.sourceforge.net
Subject: Re: bug#28166: 25.2; Batch mode not perfectly noninteractive
Date: Mon, 21 Aug 2017 17:16:54 +0300
> From: Андрей Парамонов <cmr.pent <at> gmail.com>
> Date: Mon, 21 Aug 2017 10:52:52 +0300
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 28166 <at> debbugs.gnu.org, npostavs <at> users.sourceforge.net
> 
> Upon reconsideration I now agree that this is not a bug.
> Sorry for the noise,

No need to feel sorry.

Thanks.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 19 Sep 2017 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 312 days ago.

Previous Next


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