Function: eval-region
eval-region is an interactive function defined in lread.c.
Signature
(eval-region START END &optional PRINTFLAG READ-FUNCTION)
Documentation
Execute the region as Lisp code.
When called from programs, expects two arguments,
giving starting and ending indices in the current buffer
of the text to be executed.
Programs can pass third argument PRINTFLAG which controls output:
a value of nil means discard it; anything else is stream for printing it.
See Info node (elisp)Output Streams for details on streams.
Also the fourth argument READ-FUNCTION, if non-nil, is used
instead of read to read each expression. It gets one argument
which is the input stream for reading characters.
This function does not move point.
Probably introduced at or before Emacs version 19.29.
Key Bindings
Source Code
// Defined in /usr/src/emacs/src/lread.c
{
/* FIXME: Do the eval-sexp-add-defvars dance! */
ptrdiff_t count = SPECPDL_INDEX ();
Lisp_Object tem, cbuf;
cbuf = Fcurrent_buffer ();
if (NILP (printflag))
tem = Qsymbolp;
else
tem = printflag;
specbind (Qstandard_output, tem);
specbind (Qeval_buffer_list, Fcons (cbuf, Veval_buffer_list));
/* `readevalloop' calls functions which check the type of start and end. */
readevalloop (cbuf, 0, BVAR (XBUFFER (cbuf), filename),
!NILP (printflag), Qnil, read_function,
start, end);
return unbind_to (count, Qnil);
}