Next: , Previous: , Up: Interacting With Lisp   [Contents][Index]


9.4 Compiling and Evaluating Lisp Code

These commands can greatly speed up the edit/debug cycle since they enable incremental reevaluation or recompilation of changed code, avoiding the need to compile and load an entire file.

Command: Evaluate Expression (bound to M-Escape)

This command prompts for an expression and prints the result of its evaluation in the echo area. If an error happens during evaluation, the evaluation is simply aborted, instead of going into the debugger. This command doesn’t return until the evaluation is complete.

Command: Evaluate Defun (bound to C-x C-e)
Command: Evaluate Region
Command: Evaluate Buffer

These commands evaluate text out of the current buffer, reading the current defun, the region and the entire buffer, respectively. The result of the evaluation of each form is displayed in the echo area. If the region is active, then Evaluate Defun evaluates the current region, just like Evaluate Region.

Command: Macroexpand Expression (bound to C-M)

This command shows the macroexpansion of the next expression in the null environment in a pop-up window. With an argument, it uses macroexpand instead of macroexpand-1.

Command: Re-evaluate Defvar

This command is similar to Evaluate Defun. It is used for force the re-evaluation of a defvar init form. If the current top-level form is a defvar, then it does a makunbound on the variable, and evaluates the form.

Command: Compile Defun (bound to C-x C-c)
Command: Compile Region

These commands compile the text in the current defun and the region, respectively. If the region is active, then Compile Defun compiles the current region, just like Compile Region.

Command: Load File
Hemlock Variable: Load Pathname Defaults (initial value nil)

This command prompts for a file and loads it into the current eval server using load. Load Pathname Defaults contains the default pathname for this command. This variable is set to the file loaded; if it is nil, then there is no default. This command also uses the Remote Compile File variable.


Next: Compiling Files, Previous: The Current Package, Up: Interacting With Lisp   [Contents][Index]