Two questions:
-
Where does the result of
eval-bufferget stored? How do I access it?
For example:(+ 2 2) -
Functions like
(forward-word)are executed byeval-buffer, but do not move the cursor? Why is that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
eval-bufferis usually used for side-effects, rather than return value. For example, in your .emacs file,eval-bufferwill re-load all our config settings. By default, and when used interactively, it will always returnnil. If you want to get the return value of code in a buffer, this is the wrong way to do it.eval-last-sexp, bound toC-x C-e, is one way to do so. Calling it with a prefix,C-u C-x C-ewill insert the return value into the current buffer.eval-bufferpreserves the value of point. So functions likeforward-wordwill have no visible effect.