Improve documentation of streams in batch mode

* doc/lispref/os.texi (Batch Mode):
* doc/lispref/streams.texi (Input Streams, Output Streams): Better
documentation of I/O streams in batch mode, with more
cross-references.
This commit is contained in:
Eli Zaretskii 2020-12-06 15:54:37 +02:00
parent 34feded008
commit 32090a3de4
2 changed files with 18 additions and 16 deletions

View file

@ -2609,14 +2609,14 @@ calls @var{function} with no arguments, or @samp{--eval=@var{form}}.
Any Lisp program output that would normally go to the echo area, Any Lisp program output that would normally go to the echo area,
either using @code{message}, or using @code{prin1}, etc., with either using @code{message}, or using @code{prin1}, etc., with
@code{t} as the stream, goes instead to Emacs's standard descriptors @code{t} as the stream (@pxref{Output Streams}), goes instead to
when in batch mode: @code{message} writes to the standard error Emacs's standard descriptors when in batch mode: @code{message} writes
descriptor, while @code{prin1} and other print functions write to the to the standard error descriptor, while @code{prin1} and other print
standard output. Similarly, input that would normally come from the functions write to the standard output. Similarly, input that would
minibuffer is read from the standard input descriptor. Thus, Emacs normally come from the minibuffer is read from the standard input
behaves much like a noninteractive application program. (The echo descriptor. Thus, Emacs behaves much like a noninteractive
area output that Emacs itself normally generates, such as command application program. (The echo area output that Emacs itself normally
echoing, is suppressed entirely.) generates, such as command echoing, is suppressed entirely.)
Non-ASCII text written to the standard output or error descriptors is Non-ASCII text written to the standard output or error descriptors is
by default encoded using @code{locale-coding-system} (@pxref{Locales}) by default encoded using @code{locale-coding-system} (@pxref{Locales})

View file

@ -123,13 +123,13 @@ came from. In this case, it makes no difference what value
@code{t} used as a stream means that the input is read from the @code{t} used as a stream means that the input is read from the
minibuffer. In fact, the minibuffer is invoked once and the text minibuffer. In fact, the minibuffer is invoked once and the text
given by the user is made into a string that is then used as the given by the user is made into a string that is then used as the
input stream. If Emacs is running in batch mode, standard input is used input stream. If Emacs is running in batch mode (@pxref{Batch Mode}),
instead of the minibuffer. For example, standard input is used instead of the minibuffer. For example,
@example @example
(message "%s" (read t)) (message "%s" (read t))
@end example @end example
will read a Lisp expression from standard input and print the result will in batch mode read a Lisp expression from standard input and
to standard output. print the result to standard output.
@item @code{nil} @item @code{nil}
@cindex @code{nil} input stream @cindex @code{nil} input stream
@ -392,13 +392,15 @@ is responsible for storing the characters wherever you want to put them.
@item @code{t} @item @code{t}
@cindex @code{t} output stream @cindex @code{t} output stream
The output characters are displayed in the echo area. The output characters are displayed in the echo area. If Emacs is
running in batch mode (@pxref{Batch Mode}), the output is written to
the standard output descriptor instead.
@item @code{nil} @item @code{nil}
@cindex @code{nil} output stream @cindex @code{nil} output stream
@code{nil} specified as an output stream means to use the value of @code{nil} specified as an output stream means to use the value of the
@code{standard-output} instead; that value is the @dfn{default output @code{standard-output} variable instead; that value is the
stream}, and must not be @code{nil}. @dfn{default output stream}, and must not be @code{nil}.
@item @var{symbol} @item @var{symbol}
A symbol as output stream is equivalent to the symbol's function A symbol as output stream is equivalent to the symbol's function