diff options
| author | Richard M. Stallman | 1998-06-10 04:08:49 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-06-10 04:08:49 +0000 |
| commit | 55607887e1a1a509d8030f04f1b6b9699fa469f6 (patch) | |
| tree | bbe500f5741fcb9e13fbe185ca3c7d6e2c4e6906 | |
| parent | eb542c5159b062a10c1b663302d5a886875ad37e (diff) | |
| download | emacs-55607887e1a1a509d8030f04f1b6b9699fa469f6.tar.gz emacs-55607887e1a1a509d8030f04f1b6b9699fa469f6.zip | |
*** empty log message ***
| -rw-r--r-- | lispref/eval.texi | 16 | ||||
| -rw-r--r-- | lispref/loading.texi | 6 |
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 | |||
| 625 | @code{max-lisp-eval-depth} (see below). | 625 | @code{max-lisp-eval-depth} (see below). |
| 626 | @end defun | 626 | @end defun |
| 627 | 627 | ||
| 628 | @deffn Command eval-region start end &optional stream | 628 | @deffn Command eval-region start end &optional stream read-function |
| 629 | This function evaluates the forms in the current buffer in the region | 629 | This function evaluates the forms in the current buffer in the region |
| 630 | defined by the positions @var{start} and @var{end}. It reads forms from | 630 | defined by the positions @var{start} and @var{end}. It reads forms from |
| 631 | the region and calls @code{eval} on them until the end of the region is | 631 | the region and calls @code{eval} on them until the end of the region is |
| 632 | reached, or until an error is signaled and not handled. | 632 | reached, or until an error is signaled and not handled. |
| 633 | 633 | ||
| 634 | If @var{stream} is supplied, @code{standard-output} is bound to it | 634 | If @var{stream} is non-@code{nil}, the values that result from |
| 635 | during the evaluation. | 635 | evaluating the expressions in the region are printed using @var{stream}. |
| 636 | @xref{Output Streams}. | ||
| 636 | 637 | ||
| 637 | You can use the variable @code{load-read-function} to specify a function | 638 | If @var{read-function} is non-@code{nil}, it should be a function, which |
| 638 | for @code{eval-region} to use instead of @code{read} for reading | 639 | is used instead of @code{read} to read expressions one by one. This |
| 639 | expressions. @xref{How Programs Do Loading}. | 640 | function is called with one argument, the stream for reading input. You |
| 641 | can also use the variable @code{load-read-function} (@pxref{How Programs | ||
| 642 | Do Loading}) to specify this function, but it is more robust to use the | ||
| 643 | @var{read-function} argument. | ||
| 640 | 644 | ||
| 641 | @code{eval-region} always returns @code{nil}. | 645 | @code{eval-region} always returns @code{nil}. |
| 642 | @end deffn | 646 | @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. | |||
| 146 | 146 | ||
| 147 | Normally, the variable's value is @code{nil}, which means those | 147 | Normally, the variable's value is @code{nil}, which means those |
| 148 | functions should use @code{read}. | 148 | functions should use @code{read}. |
| 149 | |||
| 150 | @strong{Note:} Instead of using this variable, it is cleaner to use | ||
| 151 | another, newer feature: to pass the function as the @var{read-function} | ||
| 152 | argument to @code{eval-region}. @xref{Eval}. | ||
| 149 | @end defvar | 153 | @end defvar |
| 150 | 154 | ||
| 151 | For information about how @code{load} is used in building Emacs, see | 155 | 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 | |||
| 720 | 724 | ||
| 721 | The command @code{eval-region} updates @code{load-history}, but does so | 725 | The command @code{eval-region} updates @code{load-history}, but does so |
| 722 | by adding the symbols defined to the element for the file being visited, | 726 | by adding the symbols defined to the element for the file being visited, |
| 723 | rather than replacing that element. | 727 | rather than replacing that element. @xref{Eval}. |
| 724 | 728 | ||
| 725 | @node Hooks for Loading | 729 | @node Hooks for Loading |
| 726 | @section Hooks for Loading | 730 | @section Hooks for Loading |