When I evaluate an expression with C-x C-e
, I see the result returned by that expression in the minibuffer, for a while.
Can I have that returned value written in the same buffer where the evalued expression is?
How?
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityThe emacs way is to ask emacs:
C-h k C-x C-e
C-x C-e runs the command eval-last-sexp (found in global-map), which
is an interactive compiled Lisp function in `elisp-mode.el'.
It is bound to C-x C-e.
(eval-last-sexp EVAL-LAST-SEXP-ARG-INTERNAL)
Probably introduced at or before Emacs version 24.4.
Evaluate sexp before point; print value in the echo area.
Interactively, with a non `-' prefix argument, print output into
current buffer.
Read that last line. Do:
C-u C-x C-e
and observe the result.
buffer-local
tag.buffer-local
in emacs is about variables having values specific to a buffer.