aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Teirlinck2003-12-25 03:42:52 +0000
committerLuc Teirlinck2003-12-25 03:42:52 +0000
commit636a7460c98ebbe224b2df8425fd6793a884b15a (patch)
treedc2cc87f16cc65da29b55bf6ead08ccef38e95cd
parent136b1dff192e1b0345c5ac92b9ed2231af2e65e1 (diff)
downloademacs-636a7460c98ebbe224b2df8425fd6793a884b15a.tar.gz
emacs-636a7460c98ebbe224b2df8425fd6793a884b15a.zip
(Function Indirection): Describe the errors that `indirect-function'
can signal. (Eval): Clarify the descriptions of `eval-region' and `values'. Describe `eval-buffer' instead of `eval-current-buffer' and mention `eval-current-buffer' as an alias for `current-buffer'. Correct the description and mention all optional arguments.
-rw-r--r--lispref/eval.texi58
1 files changed, 42 insertions, 16 deletions
diff --git a/lispref/eval.texi b/lispref/eval.texi
index 165889e75ed..fcfde5849dd 100644
--- a/lispref/eval.texi
+++ b/lispref/eval.texi
@@ -319,6 +319,10 @@ This function returns the meaning of @var{function} as a function. If
319definition and starts over with that value. If @var{function} is not a 319definition and starts over with that value. If @var{function} is not a
320symbol, then it returns @var{function} itself. 320symbol, then it returns @var{function} itself.
321 321
322This function signals a @code{void-function} error if the final
323symbol is unbound and a @code{cyclic-function-indirection} error if
324there is a loop in the chain of symbols.
325
322Here is how you could define @code{indirect-function} in Lisp: 326Here is how you could define @code{indirect-function} in Lisp:
323 327
324@smallexample 328@smallexample
@@ -625,32 +629,51 @@ The number of currently active calls to @code{eval} is limited to
625@code{max-lisp-eval-depth} (see below). 629@code{max-lisp-eval-depth} (see below).
626@end defun 630@end defun
627 631
632@anchor{Definition of eval-region}
628@deffn Command eval-region start end &optional stream read-function 633@deffn Command eval-region start end &optional stream read-function
629This function evaluates the forms in the current buffer in the region 634This function evaluates the forms in the current buffer in the region
630defined by the positions @var{start} and @var{end}. It reads forms from 635defined by the positions @var{start} and @var{end}. It reads forms from
631the region and calls @code{eval} on them until the end of the region is 636the region and calls @code{eval} on them until the end of the region is
632reached, or until an error is signaled and not handled. 637reached, or until an error is signaled and not handled.
633 638
634If @var{stream} is non-@code{nil}, the values that result from 639By default, @code{eval-region} does not produce any output. However,
635evaluating the expressions in the region are printed using @var{stream}. 640if @var{stream} is non-@code{nil}, any output produced by output
636@xref{Output Streams}. 641functions (@pxref{Output Functions}), as well as the values that
637 642result from evaluating the expressions in the region are printed using
638If @var{read-function} is non-@code{nil}, it should be a function, which 643@var{stream}. @xref{Output Streams}.
639is used instead of @code{read} to read expressions one by one. This 644
640function is called with one argument, the stream for reading input. You 645If @var{read-function} is non-@code{nil}, it should be a function,
641can also use the variable @code{load-read-function} (@pxref{How Programs 646which is used instead of @code{read} to read expressions one by one.
642Do Loading}) to specify this function, but it is more robust to use the 647This function is called with one argument, the stream for reading
648input. You can also use the variable @code{load-read-function}
649(@pxref{Definition of load-read-function,, How Programs Do Loading})
650to specify this function, but it is more robust to use the
643@var{read-function} argument. 651@var{read-function} argument.
644 652
645@code{eval-region} always returns @code{nil}. 653@code{eval-region} does not move point. It always returns @code{nil}.
646@end deffn 654@end deffn
647 655
648@cindex evaluation of buffer contents 656@cindex evaluation of buffer contents
649@deffn Command eval-current-buffer &optional stream 657@deffn Command eval-buffer &optional buffer-or-name stream filename unibyte print
650This is like @code{eval-region} except that it operates on the whole 658This is similar to @code{eval-region}, but the arguments provide
651buffer. 659different optional features. @code{eval-buffer} operates on the
660entire accessible portion of buffer @var{buffer-or-name}.
661@var{buffer-or-name} can be a buffer, a buffer name (a string), or
662@code{nil} (or omitted), which means to use the current buffer.
663@var{stream} is used as in @code{eval-region}, unless @var{stream} is
664@code{nil} and @var{print} non-@code{nil}. In that case, values that
665result from evaluating the expressions are still discarded, but the
666output of the output functions is printed in the echo area.
667@var{filename} is the file name to use for @code{load-history}
668(@pxref{Unloading}), and defaults to @code{buffer-file-name}
669(@pxref{Buffer File Name}). If @var{unibyte} is non-@code{nil},
670@code{read} converts strings to unibyte whenever possible.
671
672@findex eval-current-buffer
673@code{eval-current-buffer} is an alias for this command.
652@end deffn 674@end deffn
653 675
676@anchor{Definition of max-lisp-eval-depth}
654@defvar max-lisp-eval-depth 677@defvar max-lisp-eval-depth
655This variable defines the maximum depth allowed in calls to @code{eval}, 678This variable defines the maximum depth allowed in calls to @code{eval},
656@code{apply}, and @code{funcall} before an error is signaled (with error 679@code{apply}, and @code{funcall} before an error is signaled (with error
@@ -670,14 +693,17 @@ Entry to the Lisp debugger increases the value, if there is little room
670left, to make sure the debugger itself has room to execute. 693left, to make sure the debugger itself has room to execute.
671 694
672@code{max-specpdl-size} provides another limit on nesting. 695@code{max-specpdl-size} provides another limit on nesting.
673@xref{Local Variables}. 696@xref{Definition of max-specpdl-size,, Local Variables}.
674@end defvar 697@end defvar
675 698
676@defvar values 699@defvar values
677The value of this variable is a list of the values returned by all the 700The value of this variable is a list of the values returned by all the
678expressions that were read, evaluated, and printed from buffers 701expressions that were read, evaluated, and printed from buffers
679(including the minibuffer) by the standard Emacs commands which do this. 702(including the minibuffer) by the standard Emacs commands which do
680The elements are ordered most recent first. 703this. (Note that this does @emph{not} include evaluation in
704@samp{*ielm*} buffers, nor evaluation using @kbd{C-j} in
705@code{lisp-interaction-mode}.) The elements are ordered most recent
706first.
681 707
682@example 708@example
683@group 709@group