summaryrefslogtreecommitdiff
path: root/lispref
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-06-10 04:08:49 +0000
committerRichard M. Stallman <rms@gnu.org>1998-06-10 04:08:49 +0000
commit4fed0a3cfb90b1c40b78155fe70ddf087339f434 (patch)
treea7e40d908bb1c0e5459f8549ed45b13d4b13b6f5 /lispref
parentcca21c35c3076ca1bb93b7fe873b7ceb535477d1 (diff)
downloademacs-4fed0a3cfb90b1c40b78155fe70ddf087339f434.tar.gz
*** empty log message ***
Diffstat (limited to 'lispref')
-rw-r--r--lispref/eval.texi16
-rw-r--r--lispref/loading.texi6
2 files changed, 15 insertions, 7 deletions
diff --git a/lispref/eval.texi b/lispref/eval.texi
index d49aba1cc16..80c07bf48a6 100644
--- a/lispref/eval.texi
+++ b/lispref/eval.texi
@@ -625,18 +625,22 @@ The number of currently active calls to @code{eval} is limited to
@code{max-lisp-eval-depth} (see below).
@end defun
-@deffn Command eval-region start end &optional stream
+@deffn Command eval-region start end &optional stream read-function
This function evaluates the forms in the current buffer in the region
defined by the positions @var{start} and @var{end}. It reads forms from
the region and calls @code{eval} on them until the end of the region is
reached, or until an error is signaled and not handled.
-If @var{stream} is supplied, @code{standard-output} is bound to it
-during the evaluation.
+If @var{stream} is non-@code{nil}, the values that result from
+evaluating the expressions in the region are printed using @var{stream}.
+@xref{Output Streams}.
-You can use the variable @code{load-read-function} to specify a function
-for @code{eval-region} to use instead of @code{read} for reading
-expressions. @xref{How Programs Do Loading}.
+If @var{read-function} is non-@code{nil}, it should be a function, which
+is used instead of @code{read} to read expressions one by one. This
+function is called with one argument, the stream for reading input. You
+can also use the variable @code{load-read-function} (@pxref{How Programs
+Do Loading}) to specify this function, but it is more robust to use the
+@var{read-function} argument.
@code{eval-region} always returns @code{nil}.
@end deffn
diff --git a/lispref/loading.texi b/lispref/loading.texi
index a6efd6ebca2..fb2e3014b85 100644
--- a/lispref/loading.texi
+++ b/lispref/loading.texi
@@ -146,6 +146,10 @@ The function should accept one argument, just as @code{read} does.
Normally, the variable's value is @code{nil}, which means those
functions should use @code{read}.
+
+@strong{Note:} Instead of using this variable, it is cleaner to use
+another, newer feature: to pass the function as the @var{read-function}
+argument to @code{eval-region}. @xref{Eval}.
@end defvar
For information about how @code{load} is used in building Emacs, see
@@ -720,7 +724,7 @@ The value of @code{load-history} may have one element whose @sc{car} is
The command @code{eval-region} updates @code{load-history}, but does so
by adding the symbols defined to the element for the file being visited,
-rather than replacing that element.
+rather than replacing that element. @xref{Eval}.
@node Hooks for Loading
@section Hooks for Loading