Next: , Previous: , Up: Interactive Evaluation and Executing Lisp Expressions   [Index]


F.1.6.6 Lisp Interaction Mode

When Emacs starts up, it contains a buffer named ‘*scratch*’, which is provided for evaluating Emacs Lisp expressions interactively using the major mode Lisp Interaction Mode, whose parent mode is Emacs Lisp Mode, whose parent mode is Lisp Data Mode, and whose parent mode is Prog Mode.

M-x lisp-interaction-mode

Major mode for typing and evaluating Lisp forms in an interactive Emacs Lisp session.

Parent mode is Emacs Lisp Mode.

This mode is like Lisp mode except that ‘M-x eval-print-last-sexp’ (‘C-j’) evals the Lisp expression before point, and prints its value into the buffer, advancing point.

eval-print-last-sexp

C-j

Evaluate sexp before point; print value into current buffer.

completion-at-point

C-M-i

indent-pp-sexp

C-M-q

eval-defun

C-M-x

  1. The Scratch Buffer—scratch

    This buffer is provided for evaluating Emacs Lisp expressions interactively. Its major mode is Lisp Interaction mode.

    This buffer is useful for throw-away scripts and quick code evaluation. If you put point at the end of an sexp and type ‘C-j’ Emacs will evaluate the expression and print the result straight into the buffer.

    eval-print-last-sexp

    C-j

    Evaluate sexp before point; print value into current buffer, truncating. With a prefix argument of zero, there is no truncation.

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

    initial-scratch-message

    Variable to control the initial message in the buffer. Set it to either a documentation string or ’nil’ to suppress it.


Next: The Interactive Emacs Lisp Mode—ielm, Previous: Emacs Lisp Mode, Up: Interactive Evaluation and Executing Lisp Expressions   [Index]