summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2020-12-06 15:54:37 +0200
committerEli Zaretskii <eliz@gnu.org>2020-12-06 15:54:37 +0200
commit32090a3de4a32867aafeb905e5b134c72ec74175 (patch)
tree2982c647949a8fba34efca6cd8f1d6a22c7c420a
parent34feded008e524149d45dc33e5fc7b2cc5cb2014 (diff)
downloademacs-32090a3de4a32867aafeb905e5b134c72ec74175.tar.gz
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.
-rw-r--r--doc/lispref/os.texi16
-rw-r--r--doc/lispref/streams.texi18
2 files changed, 18 insertions, 16 deletions
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index b31ab87ff17..dad5d9966f6 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -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,
either using @code{message}, or using @code{prin1}, etc., with
-@code{t} as the stream, goes instead to Emacs's standard descriptors
-when in batch mode: @code{message} writes to the standard error
-descriptor, while @code{prin1} and other print functions write to the
-standard output. Similarly, input that would normally come from the
-minibuffer is read from the standard input descriptor. Thus, Emacs
-behaves much like a noninteractive application program. (The echo
-area output that Emacs itself normally generates, such as command
-echoing, is suppressed entirely.)
+@code{t} as the stream (@pxref{Output Streams}), goes instead to
+Emacs's standard descriptors when in batch mode: @code{message} writes
+to the standard error descriptor, while @code{prin1} and other print
+functions write to the standard output. Similarly, input that would
+normally come from the minibuffer is read from the standard input
+descriptor. Thus, Emacs behaves much like a noninteractive
+application program. (The echo area output that Emacs itself normally
+generates, such as command echoing, is suppressed entirely.)
Non-ASCII text written to the standard output or error descriptors is
by default encoded using @code{locale-coding-system} (@pxref{Locales})
diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi
index 2cd61ad04fc..f27eb0a19a5 100644
--- a/doc/lispref/streams.texi
+++ b/doc/lispref/streams.texi
@@ -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
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
-input stream. If Emacs is running in batch mode, standard input is used
-instead of the minibuffer. For example,
+input stream. If Emacs is running in batch mode (@pxref{Batch Mode}),
+standard input is used instead of the minibuffer. For example,
@example
(message "%s" (read t))
@end example
-will read a Lisp expression from standard input and print the result
-to standard output.
+will in batch mode read a Lisp expression from standard input and
+print the result to standard output.
@item @code{nil}
@cindex @code{nil} input stream
@@ -392,13 +392,15 @@ is responsible for storing the characters wherever you want to put them.
@item @code{t}
@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}
@cindex @code{nil} output stream
-@code{nil} specified as an output stream means to use the value of
-@code{standard-output} instead; that value is the @dfn{default output
-stream}, and must not be @code{nil}.
+@code{nil} specified as an output stream means to use the value of the
+@code{standard-output} variable instead; that value is the
+@dfn{default output stream}, and must not be @code{nil}.
@item @var{symbol}
A symbol as output stream is equivalent to the symbol's function