diff --git a/emacs-ide.md b/emacs-ide.md index 22c8eb24..a37574e3 100644 --- a/emacs-ide.md +++ b/emacs-ide.md @@ -238,8 +238,8 @@ running `M-x slime-compile-region`. Compile a **defun** by putting the cursor inside the "test-format" defun and pressing `C-c C-c`. -Compile the **sexp** before the point by putting the cursor after the -closing paren of `(test-format)` and pressing `C-c C-e`. +Evaluate the **sexp** before the point by putting the cursor after the +closing paren of `(test-format)` and pressing `C-x C-e`. To **evaluate** rather than compile: - evaluate a region with `C-c C-r`, @@ -252,9 +252,25 @@ See also other commands in the menu. There are a couple of pragmatic differences when choosing between compiling or evaluating. In general, it is better to *compile* top-level forms, for two reasons: -* Compiling a top-level form highlights warnings and errors in the editor, evaluation does not. -* SLIME keeps track of line-numbers of compiled forms; when a top-level form is evaluated, the file line number information is lost. -That's problematic for code navigation afterwards. + +* Compiling a top-level form highlights warnings and errors in the editor, whereas evaluation does not. +* SLIME keeps track of line-numbers of compiled forms, but when a top-level form is evaluated, the file line number information is lost. That's problematic for code navigation afterwards. + +`eval` is still useful to observe results from individual non top-level forms. For example, say you have this function: + + +~~~lisp +(defun foo () + (let ((f (open "/home/marian/test.lisp"))) + ...)) +~~~ + +Go to the end of the OPEN expression and evaluate it (`C-x C-e`), to observe the result: + +``` +=> # +``` + ---