Next: , Previous: User-interface conventions, Up: SLIME mode


3.2 Evaluation commands

These commands each evaluate a Common Lisp expression in a different way. Usually they mimic commands for evaluating Emacs Lisp code. By default they show their results in the echo area, but a prefix argument causes the results to be inserted in the current buffer.

C-x C-e
M-x slime-eval-last-expression

Evaluate the expression before point and show the result in the echo area.

C-M-x
M-x slime-eval-defun
Evaluate the current toplevel form and show the result in the echo area. `C-M-x' treats `defvar' expressions specially. Normally, evaluating a `defvar' expression does nothing if the variable it defines already has a value. But `C-M-x' unconditionally resets the variable to the initial value specified in the `defvar' expression. This special feature is convenient for debugging Lisp programs.

If C-M-x or C-x C-e is given a numeric argument, it inserts the value into the current buffer, rather than displaying it in the echo area.

C-c :
M-x slime-interactive-eval
Evaluate an expression read from the minibuffer.
C-c C-r
M-x slime-eval-region
Evaluate the region.
C-c C-p
M-x slime-pprint-eval-last-expression
Evaluate the expression before point and pretty-print the result in a fresh buffer.
C-c E
M-x slime-edit-value
Edit the value of a setf-able form in a new buffer *Edit <form>*. The value is inserted into a temporary buffer for editing and then set in Lisp when committed with C-c C-c.
C-x M-e
M-x slime-eval-last-expression-display-output
Display the output buffer and evaluate the expression preceding point. This is useful if the expression writes something to the output stream.
C-c C-u
M-x slime-undefine-function
Undefine the function, with fmakunbound, for the symbol at point.