Function: eval-print-last-sexp

eval-print-last-sexp is an interactive and byte-compiled function defined in elisp-mode.el.gz.

Signature

(eval-print-last-sexp &optional EVAL-LAST-SEXP-ARG-INTERNAL)

Documentation

Evaluate sexp before point; print value into current buffer.

Interactively, EVAL-LAST-SEXP-ARG-INTERNAL is the prefix numeric argument. Normally, this function truncates long output according to the value of the variables eval-expression-print-length and eval-expression-print-level. But if EVAL-LAST-SEXP-ARG-INTERNAL is zero, there is no such truncation, and integers are printed in several additional formats (octal, hexadecimal, and character).

If eval-expression-debug-on-error is non-nil, which is the default, this command arranges for all errors to enter the debugger.

View in manual

Probably introduced at or before Emacs version 22.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/elisp-mode.el.gz
;;; Globally accessible functionality

(defun eval-print-last-sexp (&optional eval-last-sexp-arg-internal)
  "Evaluate sexp before point; print value into current buffer.

Interactively, EVAL-LAST-SEXP-ARG-INTERNAL is the prefix numeric argument.
Normally, this function truncates long output according to the value
of the variables `eval-expression-print-length' and
`eval-expression-print-level'.  But if EVAL-LAST-SEXP-ARG-INTERNAL is zero,
there is no such truncation, and integers are printed in several additional
formats (octal, hexadecimal, and character).

If `eval-expression-debug-on-error' is non-nil, which is the default,
this command arranges for all errors to enter the debugger."
  (interactive "P")
  (let ((standard-output (current-buffer)))
    (terpri)
    (eval-last-sexp (or eval-last-sexp-arg-internal t))
    (terpri)))