Currently, in order to evaluate elist in Emacs, I need to position the cursor on the last parenthesis and emit C-x e
.
Is it possible to evaluate the entire buffer as a single elisp program without a need to position cursor?
The most general command for evaluating Lisp expressions from a buffer is eval-region. M-x eval-region parses the text of the region as one or more Lisp expressions, evaluating them one by one. M-x eval-current-buffer is similar but evaluates the entire buffer.
In a fresh Emacs window, type ESC-x lisp-interaction-mode . That will turn your buffer into a LISP terminal; pressing Ctrl+j will feed the s-expression that your cursor (called "point" in Emacs manuals' jargon) stands right behind to LISP, and will print the result.
This function can be run simply. The command [Alt][x] is used to a run a function interactively. Typing [Alt][x] switches the focus in Emacs to the minibuffer - if you then type in a function name it will be executed. To run doodlebug simply type [Alt][x] and then doodlebug.
M-x eval-buffer
or Alt+x and then type 'eval-buffer' or just type part of it and tab to autocomplete.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With