This page is meant to provide an introduction to using Emacs as a Lisp IDE. The key bindings used in the example code snippets assume an Emacs configuration similar to that provided by the .emacs file that is included as part of the Setting up an IDE with Emacs on Windows or Mac OS X page.

Note: Portacle is a portable and multi-platform CL development environment, a straightforward way to get going.

Why Use Emacs?

Emacs has fantastic support for working with Lisp code

Not tying yourself into a single CL vendor’s editor

Runs on virtually every OS and CL implementation

Extensible: awesome-emacs.

Can be customized to do many common tasks

Built-in support for different source code version control systems

Vast number of add-on packages

Emacs will probably always be around

Emacs works well either with a mouse or without a mouse

Emacs works well either in GUI mode or in the terminal

Emacs has a large user base with multiple newsgroups

Benefits of using Emacs far outweigh the effort spent in learning it

Because Org-mode

Because Magit

Because Emacs Rocks !

Emacs Lisp vs Common Lisp

Learning Emacs Lisp is useful and similar (but different from CL): Dynamic scope is everywhere There are no reader (or reader-related) functions Does not support all the types that are supported in CL Incomplete implementation of CLOS (with the add-on EIEIO package) Not all of CL is supported No numerical tower support

Some good Emacs Lisp learning resources: An Introduction to Programming in Emacs Lisp Writing GNU Emacs Extensions Wikemacs



SLIME: Superior Lisp Interaction Mode for Emacs

SLIME is the goto major mode for CL programming.

Pros: Provides REPL which is hooked to implementation directly in Emacs Has integrated Common Lisp debugger with Emacs interface Interactive object-inspector in Emacs buffer Has its own minor mode which enhances lisp-mode in many ways Supports every common Common Lisp implementation Readily available from MELPA Actively maintained Symbol completion Cross-referencing Can perform macroexpansions

Cons: Installing SLIME without MELPA can be tricky

Setup: Installing it from MELPA is straightforward. Search package-list-packages for ‘slime’ and click to install. If MELPA is configured correctly, it will install itself and all dependencies. Enable the desired contribs (SLIME does very little by defaults), e.g. (slime-setup '(slime-fancy slime-quicklisp slime-asdf)) . Run SLIME with M-x slime .



Check out this video tutorial ! (and the author’s channel, full of great stuff)

SLIME fancy, contrib packages and other extensions

SLIME’s functionalities live in packages and so-called contrib modules must be loaded to add further functionalities. The default slime-fancy includes:

slime-autodoc

slime-c-p-c

slime-editing-commands

slime-fancy-inspector

slime-fancy-trace

slime-fontifying-fu

slime-fuzzy

slime-mdot-fu

slime-macrostep

slime-presentations

slime-references

slime-repl

slime-scratch

slime-package-fu

slime-trace-dialog

SLIME also has some nice extensions like Helm-SLIME which features, among others

Fuzzy completion,

REPL and connection listing,

Fuzzy-search of the REPL history,

Fuzzy-search of the apropos documentation.

REPL interactions

From the SLIME REPL, press , to prompt for commands. There is completion over the available systems and packages. Examples:

,load-system

,reload-system

,in-package

,restart-inferior-lisp

and many more.

With the slime-quicklisp contrib, you can also ,ql to list all systems available for installation.

SLY: Sylvester the Cat’s Common Lisp IDE

SLY is a SLIME fork that contains the following improvements:

Completely redesigned REPL based on Emacs’s own full-featured comint.el

Live code annotations via a new sly-stickers contrib

Consistent interactive button interface. Everything can be copied to the REPL.

Multiple inspectors with independent history

Regexp-capable M-x sly-apropos

Contribs are first class SLY citizens, enabled by default, loaded with ASDF on demand.

Support for NAMED-READTABLES, macrostep.el and quicklisp.

Working with Lisp Code

In this short tutorial we’ll see how to:

edit Lisp code

evaluate and compile Lisp code

search Lisp code

Note: Example code assumes you are using a setup similar to what is defined in the .emacs file from the CL Cookbook site.

Packages for structured editing

In addition to the built-in Emacs commands, you have several packages at your disposal that will help to keep the parens and/or the indentation balanced. The list below is somewhat sorted by age of the extension, according to the history of Lisp editing:

Paredit - Paredit is a classic. It defines the must-have commands (move, kill, split, join a sexp,…). (visual tutorial)

Smartparens - Smartparens not only deals with parens but with everything that comes in pairs (html tags,…) and thus has features for non-lispy languages.

Lispy - Lispy reimagines Paredit with the goal to have the shortest bindings (mostly one key) that only act depending on the point position.

Paxedit - Paxedit adds commands based on the context (in a symbol, a sexp,… ) and puts efforts on whitespace cleanup and context refactoring.

Parinfer - Parinfer automatically fixes the parens depending on the indentation, or the other way round (or both !).

We personally advice to try Parinfer and the famous Paredit, then to go up the list. See explanations and even more on Wikemacs.

Editing

Forward/Backward/Up/Down movement and selection by s-expressions

;; Put the cursor on the open parens of "(defvar.." and press "C-M-f" ;; and "C-M-b" a few times to see how you move in units of sexps. Put ;; the cursor on the second additon in the "(progn" statement and ;; press "C-M-t" to swap the first addition sexp and the second ;; one. Put the cursor on the open parens of "(+ x" in defun c and ;; press "C-M-@" to highlight the entire sexp. Then press "C-M-u" to ;; expand the selection "upwards" to the enclosing "(let". Pressing ;; "C-M-d" moves to the next enclosed sexp or (if you are at the ;; beginning of a line) to the enclosed sexp on the line: (defvar a "a variable") (defun b () "a function" (+ 2 2)) (defun c () "another function" (let ((x 42)) (+ x (+ 2 2) (+ 3 3) (+ 4 4)))) (progn (+ 1 1) (+ 2 2) (+ 3 3))

Deleting s-expressions

With C-M-k and C-M-backspace (which may restart the system on gnu/linux):

;; Put the cursor on the open parens of "(progn .." and press "C-M-k" ;; to delete it. Then press "C-M-backspace" to delete the sexp before ;; the cursor (caution, on gnu/linux this keybinding may mean to ;; restart the system): (defun d () (if t (+ 3 3) (progn (+ 1 1) (if t (+ 2 2) (+ 3 3))) (+ 4 4)))

Indenting s-expressions

With C-M-q :

;; Put the cursor on the open parens of "(defun ..." and press "C-M-q" ;; to indent the code: (defun e () "A badly indented function." (let ((x 20)) (loop for i from 0 to x do (loop for j from 0 below 10 do (print j)) (if (< i 10) (let ((z nil) ) (setq z (format t "x=~d" i)) (print z)))))) ;; This is the result: (defun e () "A badly indented function." (let ((x 20)) (loop for i from 0 to x do (loop for j from 0 below 10 do (print j)) (if (< i 10) (let ((z nil) ) (setq z (format t "x=~d" i)) (print z))))))

Support for parenthesis

M-( insets a pair, M-x check-parens to spot malformed sexps, C-u <n> M-( to enclose sexps with parens:

;; Placing the cursor on a "(" or after a ")" highlights the matching ;; parens: (progn (+ 3 3) (- 2 2)) ;; A mismatched parens is highlighted in a different color (put cursor ;; after last parens and enter a ")" to see this: (- 2 2) ;; You can also type "M-x check-parens" to locate mismatched parens in ;; a buffer ;; Press "M-(" and you will get: () ;; with the cursor placed on the closing parens, ready to enter the ;; function name. ;; Put the cursor on the open parens of the "(+ 2 2)" sexp below and ;; press "C-u 2 M-(" to enclose the next 2 sexps with parens - then ;; type "+ 1" to add "1" to the result of the following 2 sexps: (progn (+ 2 2) (+ 3 3)) ;; To delete the enclosing "progn" below, put the cursor on the open ;; parens of the "(+ 1 1)" and press the following sequence of keys: ;; "C-M-k C-M-k C-M-k C-M-u C-M-k C-y M-y C-M-a C-M-q": (defun a () (progn (+ 1 1) (+ 2 2) (+ 3 3)))

Automatic code indentation

;; Indentation is automatic for Lisp forms. Example: Put the cursor ;; after the first addition form and press Enter: (progn (+ 3 3) (- 2 2)) ;; Pressing TAB will indent incorrectly indented code. Example: Put ;; the cursor at the beginning of the "(+ 3 3)" form and press TAB: (progn (+ 3 3)) ;; CL indentation rules are different from Emacs Lisp indentation ;; rules. Make certain you have the following code in a lisp mode hook ;; in your .emacs file: (set (make-local-variable lisp-indent-function) 'common-lisp-indent-function)

Code completion

Use the built-in C-c TAB to complete symbols in SLIME. You can get tooltips with company-mode.

;; The Emacs hippie-expand command will expand lisp symbols ;; (however, it only works off of lisp symbol information that is ;; either available in the buffers or a standard CL symbol) and ;; directories. For example, type in the following and press "C-c /" ;; to get a directory completion: (setq x "c:/pro

Hiding/showing code

With C-x n n (narrow) and C-x n w to widen back.

See also code folding.

;; Highlight the middle "(if ..." block and press "C-x n n" to hide ;; everything but that block ("C-x n w" restores the other code): (if a (+ 1 1)) (if b (+ 2 2)) (if c (+ 3 3)) ;; Put the cursor on "(defun b ..." and press "C-x n d" to narrow to ;; just defun b (("C-x n w" restores the other code): (defun a () (+ 1 1)) (defun b () (+ 2 2)) (defun c () (+ 3 3))

Insert a comment, comment a region with M-; , adjust text with M-q .

;; Put the cursor on the following sexp and press "M-;" to get a ;; code line comment (right-hand comment): (setq x 1) ;; Highlight the 2nd & 3rd lines and press "M-;" to comment out those ;; lines (highlighting them a 2nd time and pressing "M-;" removes the ;; comment): (+ 1 1) (+ 2 2) (+ 3 3) ;; Using Paul Foley's comment functions allows you to selectively ;; comment out embedded sexps. Example: Put the cursor on the "(+ 4 ;; 4)" sexp and press "C-c ;" to comment out that sexp. Pressing "C-c ;; ;" comments out the enclosing sexp (and on upwards). Pressing "C-c ;; :" removes the comment: (+ 1 (+ 2 (+ 3 (+ 4 4)))) ;; Emacs knows how to wrap comment text intelligently. For example, this comment line spans ;; muliple lines but is not aligned consitently ;; with the rest of the comments/code in the file (everything else ;; ends at ;; column 68. Pressing "M-q" adjusts the comments appropriately.

Evaluating and Compiling Lisp in SLIME

Compile the entire buffer by pressing C-c C-k .

Compile a region by selecting the first 2 forms in test-all and running M-x slime-compile-region .

Compile a defun by putting the cursor inside the “test-format” defun and pressing C-c C-c .

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 ,

, evaluate a defun with C-M-x ,

, evaluate the sexp before the point with C-x C-e . See also other commands in the menu.

EVALUATION VS COMPILATION

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, 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:

(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:

=> #<SB-SYS:FD-STREAM for "file /mnt/e6b00b8f-9dad-4bf4-bd40-34b1e6d31f0a/home/marian/test.lisp" {1003AAAB53}>

Searching Lisp Code

Standard Emacs text search (isearch forward/backward, regexp searches, search/replace)

C-s does an incremental search forward (e.g. - as each key is the search string is entered, the source file is searched for the first match. This can make finding specific text much quicker as you only need to type in the unique characters. Repeat searches (using the same search characters) can be done by repeatedly pressing C-s

C-r does an incremental search backward

C-s RET and C-r RET both do conventional string searches (forward and backward respectively)

C-M-s and C-M-r both do regular expression searches (forward and backward respectively)

M-% does a search/replace while C-M-% does a regular expression search/replace

Finding occurrences (occur, grep)

With M-x grep , rgrep , occur ,…

;; Use the Emacs "occur" function to find all occurances of a string ;; (or regexp) in a buffer. Example: Enter "M-x occur" and enter the ;; string "defun" to get a list of all the occurances of the ;; characters "defun" in the current buffer. (defvar aa "a" "a variable") (defun b () "a function" (+ 2 2)) (defun c () "another function" (+ 3 3)) (defmacro d (x) "a macro" `(list ,x)) ;; Use the Emacs "grep" function to find all occurances of a string ;; (or regexp) in a multiple files. Example: Enter "M-x grep" and ;; enter the string "defun *.lisp" to get a list of all the function ;; definitions in lisp files in the current directory.

See also interactive versions with helm-swoop, helm-occur, ag.el.

Lisp symbols in current source (imenu)

;; Open a lisp source file and press the middle mouse button for a ;; pop-up window listing all variables and functions in the lisp ;; source file.

See also helm-imenu and imenu-anywhere.

Go to definition

Put the cursor on any symbol and press M-. ( slime-edit-definition ) to go to its definition. Press M-, to come back.

CODEBASE NAVIGATION TIP

Use C-u M-. ( slime-edit-definition with a prefix argument) to autocomplete the symbol and navigate to it. This command always asks for a symbol even if the cursor is on one. It works with any loaded definition. Here’s a little demonstration video.

You can think of it as a imenu completion that always work for any Lisp symbol. Add in Slime’s fuzzy completion for maximum powerness!

Note that the prefix argument can be given with other keys, like M-- , which is more convenient on some keyboards.

Crossreferencing: find who’s calling, referencing, setting a symbol

Slime has a nice cross referencing facility, for example, you can see what calls a particular function or expands a macro. It presents a list of places which reference a particular entity, from there you can recompile the thing which references by pressing C-c C-c on that line. C-c C-k will recompile all the references. This is useful when modifying macros, inline functions, or constants.

The following bindings are also shown in Slime’s menu:

C-c C-w c slime-who-calls callers of a function

slime-who-calls callers of a function C-c C-w m slime-who-macroexpands places where a macro is expanded

slime-who-macroexpands places where a macro is expanded C-c C-w r slime-who-references global variable references

slime-who-references global variable references C-c C-w b slime-who-bind global variable bindings

slime-who-bind global variable bindings C-c C-w s slime-who-sets global variable setters

slime-who-sets global variable setters C-c C-w a slime-who-specializes methods specialized on a symbol

And when the slime-asdf contrib is enabled, C-c C-w d slime-who-depends-on lists dependent ASDF systems

And a general binding: M-? or M-_ *slime-edit-uses** combines all of the above, it lists every kind of references.

(thanks to Slime tips)

;; Enter "M-x shell" to bring up a shell window in the current ;; directory. Then run "etags *.lisp" to create a TAG file containing ;; all symbols in lisp files in the current directory. Then run "etags ;; -a subdir/*.lisp" to add to the TAG file symbols from all lisp ;; files in another directory. Locate the definition of the "aa" ;; variable is the s13.lisp file by putting the cursor on the "aa" in ;; the following form and pressing "M-.". (setq x aa)

Lisp symbols using ECB, the Emacs Code Browser ( s17.lisp )

;; Press "M-x ecb-activate" to start up ECB. Load a lisp file by ;; pressing the middle mouse button (or the Enter key) on any file ;; name in the ECB mini-window. Pressing the middle mouse button (or ;; the Enter key) on any definition in the ECB symbol mini-window ;; takes you to that definition. Press "C-F7" to toggle between full ;; screen and ECB views.

Lisp Documentation in Emacs - Learning About Lisp Symbols

Argument lists

When you put the cursor on a function, SLIME will show its signature in the minibuffer.

Documentation lookup

C-c C-d h looks up documentation in CLHS. But it works only on symbols, so there are two more bindings:

looks up documentation in CLHS. But it works only on symbols, so there are two more bindings: C-c C-d # for reader macros

for reader macros C-c C-d ~ for format directives

Other bindings which may be useful:

C-c C-d d describes a symbol using describe

describes a symbol using C-c C-d f describes a function using describe

Documentation

;; Enter and evaluate the following definitions, then put the cursor ;; on "(xx)" and press "C-c C-d d" to get the function documentation. (defun xx () "A do-nothing function" nil) (setf (documentation 'xx 'function) "A function that does nil.") (xx)

Inspect

;; Enter and evaluate the following definitions, then put the cursor ;; on "(xx)" and press "C-c I" or "C-c C-v C-i" (SLIME) to execute "inspect" on ;; the "xx" function. Entering "h" gives a list of help commands and ;; "q" exits the inspector. (defun xx () "A do-nothing function" nil) (setf (documentation 'xx 'function) "A function that does nil.") (xx)

Macroexpand

;; Enter the following function definition, then put the cursor on the ;; open parens of "(defun ..." and call "M-x slime-macro-expand-1" to ;; get a macroexpand-1. Then press "C-c M-m" to get a recursive ;; macroexpansion. See also the menu. (defun test (n) (loop for i from 0 below n do (print i)))

Lisp Documentation in Emacs - Lisp Documentation

;; Put the cursor on the "(format" below and press "C-c C-d d" or "F1" ;; with the example emacs configuration to get the Hyperspec page for ;; "format". Put the cursor on the "d" in the format string and press ;; "C-u F1" to get the Hyperspec page describing the "Tilde D: ;; Decimal" format character. (format t "One = ~d" 1) ;; Note: Depending on the documentation packages that have been ;; loaded, and the browser that you wish to use, the following keys ;; may be used: ;; Default W3 ;; Package Browser Browser Format-Dft Format-W3 Info ;; ========= ======= ======= ========== ========= ==== ;; Hyperspec F1 S-F1 C-u F1 C-u S-F1 ;; CLtL2 M-F1 M-S-F1 ;; ACL docs C-F1 C-S-F1 ;; Info docs C-M-F1

Consult the CLHS offline

(ql:quickload "clhs")

Then add this to your Emacs configuration:

(load "~/.quicklisp/clhs-use-local.el" 'noerror)

Miscellaneous

Synchronizing packages

C-c ~ (slime-sync-package-and-default-directory): When run in a buffer with a lisp file it will change the current package of the REPL to the package of that file and also set the current directory of the REPL to the parent directory of the file.

Calling code

C-c C-y (slime-call-defun): When the point is inside a defun and C-c C-y is pressed,

(I’ll use [] as an indication where the cursor is)

(defun foo () nil[])

then (foo []) will be inserted into the REPL, so that you can write additional arguments and run it.

If foo was in a different package than the package of the REPL, (package:foo ) or (package::foo ) will be inserted.

This feature is very useful for testing a function you just wrote.

That works not only for defun, but also for defgeneric, defmethod, defmacro, and define-compiler-macro in the same fashion as for defun.

For defvar, defparameter, defconstant: [] *foo* will be inserted (the cursor is positioned before the symbol so that you can easily wrap it into a function call).

For defclass: (make-instance ‘class-name ) .

Inserting calls to frames in the debugger

C-y in SLDB on a frame will insert a call to that frame into the REPL, e.g.,

(/ 0) => … 1: (CCL::INTEGER-/-INTEGER 1 0) …

C-y will insert (CCL::INTEGER-/-INTEGER 1 0) .

(thanks to Slime tips)

Send to the REPL

;; With the cursor on the "let", press "C-x C-e" (Slime) to ;; evaluate a lisp form by sending it to the REPL. (let ((n 20)) (loop for i from 0 below n do (print i)))

See also eval-in-repl to send any form to the repl.

Exporting symbols

C-c x (slime-export-symbol-at-point) from the slime-package-fu contrib: takes the symbol at point and modifies the :export clause of the corresponding defpackage form. It also exports the symbol. When called with a negative argument (C-u C-c x) it will remove the symbol from :export and unexport it.

M-x slime-export-class does the same but with symbols defined by a structure or a class, like accessors, constructors, and so on. It works on structures only on SBCL and Clozure CL so far. Classes should work everywhere with MOP.

Customization

There are different styles of how symbols are presented in defpackage , the default is to use uninterned symbols ( #:foo ). This can be changed:

to use keywords:

(setq slime-export-symbol-representation-function (lambda (n) (format ":%s" n)))

or strings:

(setq slime-export-symbol-representation-function (lambda (n) (format "\"%s\"" (upcase n))))

Project Management

ASDF is the de-facto build facility. It is shipped in most Common Lisp implementations.

Comparing versions of code (ediff)

Start the ediff utility by entering M-x ediff . Enter two file names, press the space bar to step through the changes, and q to exit.

Of course, see also magit for a wonderful git integration into Emacs.

Questions/Answers

utf-8 encoding

You might want to set this to your init file:

(set-language-environment "UTF-8") (setenv "LC_CTYPE" "en_US.UTF-8")

and for Sly:

(setq sly-lisp-implementations '((sbcl ("/usr/local/bin/sbcl") :coding-system utf-8-unix) ))

This will avoid getting ascii stream decoding error s when you have non-ascii characters in files you evaluate with SLIME.

Standard shell

I switch between UNIX® and Windows environments and, although Emacs makes this switch a lot easier, I find it inconvenient having to use different Shell environments on different operating systems.

On Windows, the Cygwin tools provide a lot of the same tools that are available under UNIX® as well as a BASH shell. Alternatively, you might want to consider using eshell, a shell written in Emacs Lisp that comes as a standard feature in Emacs. If you use the given Emacs configuration, you can access eshell by pressing “F12”.

I would like to use Emacs with Franz’s ACL but find that I use the Franz tools so much that I can’t afford to not load their IDE.

It doesn’t have to be an either/or decision. On Windows, Franz allows you to specify (under Options) that Emacs is to be the default editor in place of their built-in editor. On UNIX®, Emacs also works very well together with the Franz tools.*

Windows-style cut/copy/paste

I want to use Emacs on a Windows machine. Unfortunately, I have the Windows cut/copy/paste key bindings burned into my fingertips and would find it very difficult to switch back and forth between the Windows standard for these shortcut keys and the Emacs standard.

Luckily, you don’t have to! Download cua.el and you can continue to use the Windows defaults. In fact, you may find that the following commands in your .emacs file will make Emacs more Windows-like:

;; Windows-like mouse/arrow movement & selection (pc-selection-mode) (delete-selection-mode t) ;; C-z=Undo, C-c=Copy, C-x=Cut, C-v=Paste (needs cua.el) (require 'cua) (CUA-mode t)

Simplified Emacs setup

There was a lot of Emacs Lisp code presented in this paper. Do I really have to type in all this stuff to get started with Emacs and Lisp?

No, you can add yourself just what’s needed to get SLIME working.

You can try Portacle which has everything ready.

There is also a sample .emacs file that can be used to get started. It contains all of the configurations that have been described in this page and (hopefully) should work with some minor tweaking. See the CL-Cookbook page on “Setting up an IDE with Emacs on Windows or Mac OS X”.

Appendix

All Slime REPL shortcuts

Here is the reference of all Slime shortcuts that work in the REPL.

To see them, go in a REPL, type C-h m and go to the Slime REPL map section.

REPL mode defined in ‘slime-repl.el’: Major mode for interacting with a superior Lisp. key binding --- ------- C-c Prefix Command C-j slime-repl-newline-and-indent RET slime-repl-return C-x Prefix Command ESC Prefix Command SPC slime-space (that binding is currently shadowed by another mode) , slime-handle-repl-shortcut DEL backward-delete-char-untabify <C-down> slime-repl-forward-input <C-return> slime-repl-closing-return <C-up> slime-repl-backward-input <return> slime-repl-return C-x C-e slime-eval-last-expression C-c C-c slime-interrupt C-c C-n slime-repl-next-prompt C-c C-o slime-repl-clear-output C-c C-p slime-repl-previous-prompt C-c C-s slime-complete-form C-c C-u slime-repl-kill-input C-c C-z other-window C-c ESC Prefix Command C-c I slime-repl-inspect M-RET slime-repl-closing-return M-n slime-repl-next-input M-p slime-repl-previous-input M-r slime-repl-previous-matching-input M-s previous-line C-c C-z run-lisp (that binding is currently shadowed by another mode) C-M-x lisp-eval-defun C-M-q indent-sexp C-M-q prog-indent-sexp (that binding is currently shadowed by another mode) C-c M-e macrostep-expand C-c M-i slime-fuzzy-complete-symbol C-c M-o slime-repl-clear-buffer

All other Slime shortcuts

Here are all the default keybindings defined by Slime mode.

To see them, go in a .lisp file, type C-h m and go to the Slime section.

Commands to compile the current buffer’s source file and visually highlight any resulting compiler notes and warnings: C-c C-k - Compile and load the current buffer’s file. C-c M-k - Compile (but not load) the current buffer’s file. C-c C-c - Compile the top-level form at point. Commands for visiting compiler notes: M-n - Goto the next form with a compiler note. M-p - Goto the previous form with a compiler note. C-c M-c - Remove compiler-note annotations in buffer. Finding definitions: M-. - Edit the definition of the function called at point. M-, - Pop the definition stack to go back from a definition. Documentation commands: C-c C-d C-d - Describe symbol. C-c C-d C-a - Apropos search. C-c M-d - Disassemble a function. Evaluation commands: C-M-x - Evaluate top-level from containing point. C-x C-e - Evaluate sexp before point. C-c C-p - Evaluate sexp before point, pretty-print result. Full set of commands: key binding --- ------- C-c Prefix Command C-x Prefix Command ESC Prefix Command SPC slime-space C-c C-c slime-compile-defun C-c C-j slime-eval-last-expression-in-repl C-c C-k slime-compile-and-load-file C-c C-s slime-complete-form C-c C-y slime-call-defun C-c ESC Prefix Command C-c C-] slime-close-all-parens-in-sexp C-c x slime-export-symbol-at-point C-c ~ slime-sync-package-and-default-directory C-M-a slime-beginning-of-defun C-M-e slime-end-of-defun M-n slime-next-note M-p slime-previous-note C-M-, slime-previous-location C-M-. slime-next-location C-c TAB completion-at-point C-c RET slime-expand-1 C-c C-p slime-pprint-eval-last-expression C-c C-u slime-undefine-function C-c ESC Prefix Command C-c C-b slime-interrupt C-c C-d slime-doc-map C-c C-e slime-interactive-eval C-c C-l slime-load-file C-c C-r slime-eval-region C-c C-t slime-toggle-fancy-trace C-c C-v Prefix Command C-c C-w slime-who-map C-c C-x Prefix Command C-c C-z slime-switch-to-output-buffer C-c ESC Prefix Command C-c : slime-interactive-eval C-c < slime-list-callers C-c > slime-list-callees C-c E slime-edit-value C-c I slime-inspect C-x C-e slime-eval-last-expression C-x 4 Prefix Command C-x 5 Prefix Command C-M-x slime-eval-defun M-, slime-pop-find-definition-stack M-. slime-edit-definition M-? slime-edit-uses M-_ slime-edit-uses C-c M-c slime-remove-notes C-c M-e macrostep-expand C-c M-i slime-fuzzy-complete-symbol C-c M-k slime-compile-file C-c M-q slime-reindent-defun C-c M-m slime-macroexpand-all C-c C-v C-d slime-describe-presentation-at-point C-c C-v TAB slime-inspect-presentation-at-point C-c C-v C-n slime-next-presentation C-c C-v C-p slime-previous-presentation C-c C-v C-r slime-copy-presentation-at-point-to-repl C-c C-v C-w slime-copy-presentation-at-point-to-kill-ring C-c C-v ESC Prefix Command C-c C-v SPC slime-mark-presentation C-c C-v d slime-describe-presentation-at-point C-c C-v i slime-inspect-presentation-at-point C-c C-v n slime-next-presentation C-c C-v p slime-previous-presentation C-c C-v r slime-copy-presentation-at-point-to-repl C-c C-v w slime-copy-presentation-at-point-to-kill-ring C-c C-v C-SPC slime-mark-presentation C-c C-w C-a slime-who-specializes C-c C-w C-b slime-who-binds C-c C-w C-c slime-who-calls C-c C-w RET slime-who-macroexpands C-c C-w C-r slime-who-references C-c C-w C-s slime-who-sets C-c C-w C-w slime-calls-who C-c C-w a slime-who-specializes C-c C-w b slime-who-binds C-c C-w c slime-who-calls C-c C-w d slime-who-depends-on C-c C-w m slime-who-macroexpands C-c C-w r slime-who-references C-c C-w s slime-who-sets C-c C-w w slime-calls-who C-c C-d C-a slime-apropos C-c C-d C-d slime-describe-symbol C-c C-d C-f slime-describe-function C-c C-d C-g common-lisp-hyperspec-glossary-term C-c C-d C-p slime-apropos-package C-c C-d C-z slime-apropos-all C-c C-d # common-lisp-hyperspec-lookup-reader-macro C-c C-d a slime-apropos C-c C-d d slime-describe-symbol C-c C-d f slime-describe-function C-c C-d g common-lisp-hyperspec-glossary-term C-c C-d h slime-documentation-lookup C-c C-d p slime-apropos-package C-c C-d z slime-apropos-all C-c C-d ~ common-lisp-hyperspec-format C-c C-d C-# common-lisp-hyperspec-lookup-reader-macro C-c C-d C-~ common-lisp-hyperspec-format C-c C-x c slime-list-connections C-c C-x n slime-next-connection C-c C-x p slime-prev-connection C-c C-x t slime-list-threads C-c M-d slime-disassemble-symbol C-c M-p slime-repl-set-package C-x 5 . slime-edit-definition-other-frame C-x 4 . slime-edit-definition-other-window C-c C-v M-o slime-clear-presentations

Page source: emacs-ide.md