Evaluates a region of the text in an editor-pane in a Listener.
capi
editor-pane-evaluate-region-in-listener editor-pane region-spec &optional listener
editor-pane⇩ |
An editor-pane. |
region-spec⇩ | |
listener⇩ | nil or a listener-pane. |
The function editor-pane-evaluate-region-in-listener
evaluates the region that is specified by region-spec inside the buffer of editor-pane (the result of editor-pane-buffer).
editor-pane-evaluate-region-in-listener
first looks for a Listener:
It then chooses the region, based on region-spec.
:buffer
, the region is the whole of the buffer.:region
, the region is the highlighted region of the buffer. If there is no highlighted region, a warning is signalled and no evaluation occurs.
editor-pane-evaluate-region-in-listener
then repeatedly reads forms from the region and evaluates them in the Listener, until it reaches the end of the region.
The reading is done in the appropriate context of the buffer, most importantly in the correct package. The evaluation is done in the context of the Listener. Most importantly it means that any output of the evaluation (and results) appear in the Listener, but also all the dynamic enviroment of the Listener, including error handling, is applicable.
CAPI User Guide and Reference Manual (Windows version) - 18 Feb 2025 15:35:34