all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#28166: 25.2; Batch mode not perfectly noninteractive
@ 2017-08-20 19:52 Андрей Парамонов
  2017-08-20 20:13 ` npostavs
  0 siblings, 1 reply; 9+ messages in thread
From: Андрей Парамонов @ 2017-08-20 19:52 UTC (permalink / raw)
  To: 28166

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

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)

[-- Attachment #2: Type: text/html, Size: 3168 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#28166: 25.2; Batch mode not perfectly noninteractive
  2017-08-20 19:52 bug#28166: 25.2; Batch mode not perfectly noninteractive Андрей Парамонов
@ 2017-08-20 20:13 ` npostavs
  2017-08-21  1:15   ` Андрей Парамонов
  0 siblings, 1 reply; 9+ messages in thread
From: npostavs @ 2017-08-20 20:13 UTC (permalink / raw)
  To: Андрей Парамонов
  Cc: 28166

tags 28166 notabug
quit

Андрей Парамонов <cmr.pent@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.






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#28166: 25.2; Batch mode not perfectly noninteractive
  2017-08-20 20:13 ` npostavs
@ 2017-08-21  1:15   ` Андрей Парамонов
  2017-08-21  2:30     ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Андрей Парамонов @ 2017-08-21  1:15 UTC (permalink / raw)
  To: npostavs; +Cc: 28166

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

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

[-- Attachment #2: Type: text/html, Size: 1189 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#28166: 25.2; Batch mode not perfectly noninteractive
  2017-08-21  1:15   ` Андрей Парамонов
@ 2017-08-21  2:30     ` Eli Zaretskii
  2017-08-21  2:42       ` Андрей Парамонов
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2017-08-21  2:30 UTC (permalink / raw)
  To: Андрей Парамонов
  Cc: 28166, npostavs

> From: Андрей Парамонов
> 	<cmr.pent@gmail.com>
> Date: Mon, 21 Aug 2017 04:15:06 +0300
> Cc: 28166@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?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#28166: 25.2; Batch mode not perfectly noninteractive
  2017-08-21  2:30     ` Eli Zaretskii
@ 2017-08-21  2:42       ` Андрей Парамонов
  2017-08-21  3:28         ` npostavs
  2017-08-21  7:49         ` Andreas Schwab
  0 siblings, 2 replies; 9+ messages in thread
From: Андрей Парамонов @ 2017-08-21  2:42 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 28166, npostavs

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

2017-08-21 5:30 GMT+03:00 Eli Zaretskii <eliz@gnu.org>:

> > From: Андрей Парамонов
> >       <cmr.pent@gmail.com>
> > Date: Mon, 21 Aug 2017 04:15:06 +0300
> > Cc: 28166@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

[-- Attachment #2: Type: text/html, Size: 1354 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#28166: 25.2; Batch mode not perfectly noninteractive
  2017-08-21  2:42       ` Андрей Парамонов
@ 2017-08-21  3:28         ` npostavs
  2017-08-21  7:49         ` Andreas Schwab
  1 sibling, 0 replies; 9+ messages in thread
From: npostavs @ 2017-08-21  3:28 UTC (permalink / raw)
  To: Андрей Парамонов
  Cc: 28166

Андрей Парамонов <cmr.pent@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.
      [...]





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#28166: 25.2; Batch mode not perfectly noninteractive
  2017-08-21  2:42       ` Андрей Парамонов
  2017-08-21  3:28         ` npostavs
@ 2017-08-21  7:49         ` Andreas Schwab
  2017-08-21  7:52           ` Андрей Парамонов
  1 sibling, 1 reply; 9+ messages in thread
From: Andreas Schwab @ 2017-08-21  7:49 UTC (permalink / raw)
  To: Андрей Парамонов
  Cc: 28166, npostavs

On Aug 21 2017, Андрей Парамонов <cmr.pent@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@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#28166: 25.2; Batch mode not perfectly noninteractive
  2017-08-21  7:49         ` Andreas Schwab
@ 2017-08-21  7:52           ` Андрей Парамонов
  2017-08-21 14:16             ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Андрей Парамонов @ 2017-08-21  7:52 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 28166, npostavs

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

Upon reconsideration I now agree that this is not a bug.
Sorry for the noise,
Andrey Paramonov

[-- Attachment #2: Type: text/html, Size: 242 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#28166: 25.2; Batch mode not perfectly noninteractive
  2017-08-21  7:52           ` Андрей Парамонов
@ 2017-08-21 14:16             ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2017-08-21 14:16 UTC (permalink / raw)
  To: Андрей Парамонов
  Cc: schwab, 28166, npostavs

> From: Андрей Парамонов <cmr.pent@gmail.com>
> Date: Mon, 21 Aug 2017 10:52:52 +0300
> Cc: Eli Zaretskii <eliz@gnu.org>, 28166@debbugs.gnu.org, npostavs@users.sourceforge.net
> 
> Upon reconsideration I now agree that this is not a bug.
> Sorry for the noise,

No need to feel sorry.

Thanks.





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-08-21 14:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-20 19:52 bug#28166: 25.2; Batch mode not perfectly noninteractive Андрей Парамонов
2017-08-20 20:13 ` npostavs
2017-08-21  1:15   ` Андрей Парамонов
2017-08-21  2:30     ` Eli Zaretskii
2017-08-21  2:42       ` Андрей Парамонов
2017-08-21  3:28         ` npostavs
2017-08-21  7:49         ` Andreas Schwab
2017-08-21  7:52           ` Андрей Парамонов
2017-08-21 14:16             ` Eli Zaretskii

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.