\input texinfo @c %**start of header @setfilename sly.info @iftex @documentencoding UTF-8 @codequoteundirected on @codequotebacktick on @end iftex @dircategory Emacs @direntry * SLY: (sly). Common-Lisp IDE @end direntry @c %**end of header @set SLYVER 1.0.42 @set UPDATED @today{} @set TITLE SLY User Manual @settitle @value{TITLE}, version @value{SLYVER} @copying Written for SLIME Luke Gorrie and others, rewritten by João Távora for SLY. This file has been placed in the public domain. @end copying @c For screenshots use @c (make-frame '((height . 32) (width . 90) (font . "Andale Mono 13"))) @c (make-frame '((height . 32) (width . 90) (font . "DejaVu Sans Mono 10"))) @c M-x load-theme RET base16-bright-light RET @c preferably on Mac OSX, then Cmd-Shift-4 SPC and click the window @titlepage @title @value{TITLE} @sp 10 @example _____ __ __ __ / ___/ / / \ \/ / |\ _,,,---,,_ \__ \ / / \ / /,`.-'`' -. ;-;;,_ ___/ / / /___ / / |,4- ) )-,_..;\ ( `'-' /____/ /_____/ /_/ '---''(_/--' `-'\_) @end example @sp 10 @subtitle version @value{SLYVER} @page @insertcopying @end titlepage @c Macros @macro SLY @acronym{SLY} @end macro @macro SLIME @acronym{SLIME} @end macro @macro SLY-DB @acronym{SLY-DB} @end macro @macro REPL @acronym{REPL} @end macro @macro Git @acronym{Git} @end macro @macro kbditem{key, command} @item \key\ @itemx M-x \command\ @kindex \key\ @findex \command\ @c @end macro @macro kbditempair{key1, key2, command1, command2} @item \key1\, M-x \command1\ @itemx \key2\, M-x \command2\ @kindex \key1\ @kindex \key2\ @findex \command1\ @findex \command2\ @c @end macro @macro cmditem{command} @item M-x \command\ @findex \command\ @c @end macro @macro kbdanchorc{key, command, comment} @anchor{\command\} @item \key\ @code{\command\} @i{\comment\}@* @end macro @macro fcnindex{name} @item \name\ @xref{\name\}. @end macro @c Merge the variable and concept indices because both are rather short @synindex cp vr @c @setchapternewpage off @c @shortcontents @contents @ifnottex @node Top @top SLY @SLY{} is a Common Lisp IDE for Emacs. This is the manual for version @value{SLYVER}. (Last updated @value{UPDATED}) @insertcopying @end ifnottex @menu * Introduction:: * Getting started:: * A SLY tour for SLIME users:: * Working with source files:: * Common functionality:: * SLY REPL and other special buffers:: * Customization:: * Tips and Tricks:: * Extensions:: * Credits:: * Key Index:: * Command Index:: * Variable Index:: @detailmenu --- The Detailed Node Listing --- Getting started * Platforms:: * Downloading:: * Basic setup:: * Running:: * Basic customization:: * Multiple Lisps:: Working with source files * Evaluation:: * Compilation:: * Autodoc:: * Semantic indentation:: * Reader conditionals:: * Macro-expansion:: Common functionality * Finding definitions:: * Cross-referencing:: * Completion:: * Interactive objects:: * Documentation:: * Multiple connections:: * Disassembly:: * Recovery:: * Temporary buffers:: * Multi-threading:: SLY REPL and other special buffers * REPL:: * Inspector:: * Debugger:: * Trace Dialog:: * Stickers:: SLY REPL: the ``top level'' * REPL commands:: * REPL output:: * REPL backreferences:: The SLY-DB Debugger * Examining frames:: * Restarts:: * Frame Navigation:: * Miscellaneous:: Customization * Emacs-side:: * Lisp-side customization:: Emacs-side * Keybindings:: * Keymaps:: * Defcustom variables:: * Hooks:: Lisp-side (Slynk) * Communication style:: * Other configurables:: Tips and Tricks * Connecting to a remote Lisp:: * Loading Slynk faster:: * Auto-SLY:: * REPLs and game loops:: * Controlling SLY from outside Emacs:: Connecting to a remote Lisp * Setting up the Lisp image:: * Setting up Emacs:: * Setting up pathname translations:: Extensions * Loading and unloading:: * More contribs:: More contribs * TRAMP Support:: * Scratch Buffer:: @end detailmenu @end menu @node Introduction @chapter Introduction @SLY{} is Sylvester the Cat's Common Lisp IDE. It extends Emacs with support for interactive programming in Common Lisp. The features are centered around an Emacs minor-mode called @code{sly-mode}, which complements the standard major-mode @code{lisp-mode} for editing Lisp source files. @code{sly-mode} adds support for interacting with a running Common Lisp process for compilation, debugging, documentation lookup, and so on. @SLY{} attempts to follow the example of Emacs's own native Emacs-Lisp environment. Many of the keybindings and interface concepts used to interact with Emacs's Elisp machine are reused in @SLY{} to interact with the underlying Common Lisp run-times. Emacs makes requests to these processes, asking them to compile files or code snippets; deliver introspection information various objects; or invoke commands or debugging restarts. Internally, @SLY{}'s user-interface, written in Emacs Lisp, is connected via sockets to one or more instances of a server program called ``Slynk'' that is running in the Lisp processes. The two sides communicate using a Remote Procedure Call (@acronym{RPC}) protocol. The Lisp-side server is primarily written in portable Common Lisp. However, because some non-standard functionality is provided differently by each Lisp implementation (SBCL, CMUCL, Allegro, etc...) the Lisp-side server is again split into two parts -- portable and non-portable implementation -- which communicate using a well-defined interface. Each Lisp implementation provides a separate implementation of that interface, making @SLY{} as a whole readily portable. @SLY{} is a direct fork of @acronym{SLIME}, the ``Superior Lisp Interaction Mode for Emacs'', which itself derived from previous Emacs programs such as @acronym{SLIM} and @acronym{ILISP}. If you already know @acronym{SLIME}, @SLY{}'s closeness to it is immediately apparent. However, where @acronym{SLIME} has traditionally focused on the stability of its core functionality, @SLY{} aims for a richer feature set, a more consistent user interface, and an experience generally closer to Emacs' own. To understand the differences between the two projects read @SLY{}'s @uref{https://github.com/joaotavora/sly/blob/master/NEWS.md,,NEWS.md} file. For a hand-on approach to these differences you might want to @ref{A SLY tour for SLIME users}. @node Getting started @chapter Getting started This chapter tells you how to get @SLY{} up and running. @menu * Platforms:: * Downloading:: * Basic setup:: * Running:: * Basic customization:: * Multiple Lisps:: @end menu @node Platforms @section Supported Platforms @SLY{} supports a wide range of operating systems and Lisp implementations. @SLY{} runs on Unix systems, Mac OSX, and Microsoft Windows. GNU Emacs versions 24.4 and above are supported. @emph{XEmacs or Emacs 23 are notably not supported}. The supported Lisp implementations, roughly ordered from the best-supported, are: @itemize @bullet @item CMU Common Lisp (@acronym{CMUCL}), 19d or newer @item Steel Bank Common Lisp (@acronym{SBCL}), 1.0 or newer @item Clozure Common Lisp (@acronym{CCL}), version 1.3 or newer @item LispWorks, version 4.3 or newer @item Allegro Common Lisp (@acronym{ACL}), version 6 or newer @item @acronym{CLISP}, version 2.35 or newer @item Armed Bear Common Lisp (@acronym{ABCL}) @item Scieneer Common Lisp (@acronym{SCL}), version 1.2.7 or newer @item Embedded Common Lisp (@acronym{ECL}) @item ManKai Common Lisp (@acronym{MKCL}) @item Clasp @end itemize Most features work uniformly across implementations, but some are prone to variation. These include the precision of placing compiler-note annotations, @acronym{XREF} support, and fancy debugger commands (like ``restart frame''). @node Downloading @section Downloading SLY By far the easiest method for getting @SLY{} up and running is using Emacs’ package system configured to the popular MELPA repository. This snippet of code should already be in your configuration: @example (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) (package-initialize) @end example You should now be able to issue the command @kbd{M-x package-install}, choose @kbd{sly} and have it be downloaded and installed automatically. If you don’t find it in the list, ensure you run @kbd{M-x package-refresh-contents} first. In other situations, such as when developing @SLY{} itself, you can access the @Git{} repository directly: @example git clone https://github.com/joaotavora/sly.git @end example If you want to hack on @SLY{}, use Github's @emph{fork} functionality and submit a @emph{pull request}. Be sure to first read the @uref{https://github.com/joaotavora/sly/blob/master/CONTRIBUTING.md,,CONTRIBUTING.md} file first. @node Basic setup @section Basic setup If you installed @SLY{} from MELPA, it is quite possible that you don’t need any more configuration, provided that @SLY{} can find a suitable Lisp executable in your @code{PATH} environment variable. Otherwise, you need to tell it where a Lisp program can be found, so customize the variable @code{inferior-lisp-program} (@pxref{Defcustom variables}) or add a line like this one to your @file{~/.emacs} or @file{~/.emacs.d/init.el} (@pxref{Emacs Init File}). @example (setq inferior-lisp-program "/opt/sbcl/bin/sbcl") @end example After evaluating this, you should be able to execute @kbd{M-x sly} and be greeted with a @REPL{}. If you cloned from the @Git{} repository, you’ll have to add a couple of more lines to your initialization file configuration: @example (add-to-list 'load-path "~/dir/to/cloned/sly") (require 'sly-autoloads) @end example @node Running @section Running SLY @SLY{} can either ask Emacs to start its own Lisp subprocesss or connect to a running process on a local or remote machine. The first alternative is more common for local development and is started via @kbd{M-x sly}. The ``inferior'' Lisp process thus started is told to load the Lisp-side server known as ``Slynk'' and then a socket connection is established between Emacs and Lisp. Finally a @REPL{} buffer is created where you can enter Lisp expressions for evaluation. The second alternative uses @kbd{M-x sly-connect}. This assumes that that a Slynk server is running on some local or remote host, and listening on a given port. @kbd{M-x sly-connect} prompts the user for these values, and upon connection the @REPL{} is established. @node Basic customization @section Basic customization A big part of Emacs, and Emacs’s extensions, are its near-infinite customization possibilities. @SLY{} is no exception, because it runs on both Emacs and the Lisp process, there are layers of Emacs-side customization and Lisp-side customization. But don’t be put off by this! @SLY{} tries hard to provide sensible defaults that don’t ``hide'' any fanciness beneath layers of complicated code, so that even a setup with no customization at all exposes @SLY{}’s most important functionality. Emacs-side customization is usually done via Emacs-lisp code snippets added to the user’s initialization file, usually @file{$HOME/.emacs} or @file{$HOME/.emacs.d/init.el} (@pxref{Emacs Init File}). 90% of Emacs-lisp customization happens in either ``keymaps'' or ``hooks'' (@pxref{Emacs-side}). Still on the Emacs side, there is also a separate interface, appropriately called @code{customize} (or sometimes just @code{custom}), that uses a nicer UI with mouse-clickable buttons to set some special variables. See @xref{Defcustom variables}. Lisp-side customization is done exclusively via Common Lisp code snippets added to the user’s @file{$HOME/.slynkrc} file. See @xref{Lisp-side customization}. As a preview, take this simple example of a frequently customized part of @SLY{}: its keyboard shortcuts, known as ``keybindings''. In the following snippet @kbd{M-h} is added to @code{sly-prefix-map} thus yielding @kbd{C-c M-h} as a shortcut to the @code{sly-documentation-lookup} command. @example (eval-after-load 'sly `(define-key sly-prefix-map (kbd "M-h") 'sly-documentation-lookup)) @end example @node Multiple Lisps @section Multiple Lisps By default, the command @kbd{M-x sly} starts the program specified with @code{inferior-lisp-program}, a variable that you can customize (@pxref{Defcustom variables}). However, if you invoke @kbd{M-x sly} with a @emph{prefix argument}, meaning you type @kbd{C-u M-x sly} then Emacs prompts for the program which should be started instead. If you need to do this frequently or if the command involves long filenames it's more convenient to set the @code{sly-lisp-implementations} variable in your initialization file (@pxref{Emacs Init File}). For example here we define two programs: @lisp (setq sly-lisp-implementations '((cmucl ("cmucl" "-quiet")) (sbcl ("/opt/sbcl/bin/sbcl") :coding-system utf-8-unix))) @end lisp Now, if you invoke @SLY{} with a @emph{negative} prefix argument, @kbd{M-- M-x sly}, you can select a program from that list. When called without a prefix, either the name specified in @code{sly-default-lisp}, or the first item of the list will be used. The elements of the list should look like @lisp (NAME (PROGRAM PROGRAM-ARGS...) &key CODING-SYSTEM INIT INIT-FUNCTION ENV) @end lisp @table @code @item NAME is a symbol and is used to identify the program. @item PROGRAM is the filename of the program. Note that the filename can contain spaces. @item PROGRAM-ARGS is a list of command line arguments. @item CODING-SYSTEM the coding system for the connection. (@pxref{sly-net-coding-system})x @item INIT should be a function which takes two arguments: a filename and a character encoding. The function should return a Lisp expression as a string which instructs Lisp to start the Slynk server and to write the port number to the file. At startup, @SLY{} starts the Lisp process and sends the result of this function to Lisp's standard input. As default, @code{sly-init-command} is used. An example is shown in @ref{init-example,,Loading Slynk faster}. @item INIT-FUNCTION should be a function which takes no arguments. It is called after the connection is established. (See also @ref{sly-connected-hook}.) @item ENV specifies a list of environment variables for the subprocess. E.g. @lisp (sbcl-cvs ("/home/me/sbcl-cvs/src/runtime/sbcl" "--core" "/home/me/sbcl-cvs/output/sbcl.core") :env ("SBCL_HOME=/home/me/sbcl-cvs/contrib/")) @end lisp initializes @code{SBCL_HOME} in the subprocess. @end table @node A SLY tour for SLIME users @chapter A SLY tour for SLIME users The chances are that if you’re into Common Lisp, you already know about @SLIME{}, the project that originated @SLY{}. Itself originating in older Emacs extensions @acronym{SLIM} and @acronym{ILISP}, @SLIME{} has been around for at least a decade longer than @SLY{} and is quite an amazing IDE. It seems reasonable to assume that most Lispers have some experience with it, and perhaps it is an even more reasonable idea to provide, in the form of a quick tutorial, a hands-on overview of some of the improvements of @SLY{} over @SLIME{}. When you start @SLY{} with @kbd{M-x sly} (@pxref{Basic setup}) you are greeted with its @REPL{}, a common starting point of Lisp hacking sessions. This has been completely redesigned in @SLY{}: you can spawn multiple REPL sessions with @code{sly-mrepl-new}; copy objects from most places directly into it (with @kbd{M-RET} and @kbd{M-S-RET}); and use a much more powerful incremental history search engine (with @kbd{C-r}). @*@image{images/tutorial-1,350pt}@* Starting from the new @REPL{}, let's showcase some of @SLY{}’s features. Let’s pretend we want to hack an existing Lisp project, say @SLY{} itself, or rather a part of its Lisp server which is called Slynk. Let's pretend we're intrigued by the way its ``flex''-style completion works. What is ``flex''-style completion, you ask? Well, if you're at the @REPL{} you can try it now: it's a way of @kbd{TAB}-completing (@pxref{Completion}) symbol names based on educated guesses of a few letters. Thus if we type @code{mvbind}, @SLY{} guesses that we probably meant @code{multiple-value-bind}, and if we type @code{domat} it might possibly guess @code{cl-ppcre:do-matches}. Let's dig into the code that makes this happen. Where should we start though, if we know very little about this project? Well, a good point to start is always the @emph{apropos} functionality, which is a @code{grep} of sorts, but symbolic rather than purely textual. In @SLY{}, @code{sly-apropos} will use the @code{CL-PPCRE} library if it finds is it loaded, else it falls back to a regex-less mode of searching. If you have @uref{https://www.quicklisp.org/beta/,Quicklisp} you need only type @code{(ql:quickload :cl-ppcre)} from the @REPL{}. So if we want to hack on @SLY{}'s ``flex-completion'' functionality, but we don't any of its symbol's names. We type @kbd{C-c C-d C-z} (the shortcut for @kbd{M-x sly-apropos-all}) and then type in ``sly.*flex'' at the prompt, followed by @kbd{enter} or @kbd{return} (abbreviated @code{RET} or @kbd{C-m}). @SLY{} should now present all Lisp symbols matching your search pattern. @*@image{images/tutorial-2,350pt}@* In the @code{apropos} buffer, let’s examine, by right-clicking it, the symbol @code{SLY-COMPLETIONS:FLEX-COMPLETIONS}. We’ll be presented with a context menu with options for describing the symbol, inspecting it, or navigating to its source definition. In general, the Lisp-side objects that SLY presents --- symbols, CLOS objects, function calls, etc... --- are right-clickable buttons with such a context menu (@pxref{Interactive objects}). For now, let’s navigate to the source definition of the symbol by choosing ``Go To source'' from the menu. We could also have just pressed @kbd{M-.} on the symbol, of course. From the Lisp source buffer that we landed on (probably @file{slynk-completion.lisp}), let’s @emph{trace} the newly found function @code{SLY-COMPLETIONS:FLEX-COMPLETIONS}. However, instead of using the regular @code{CL:TRACE}, we’ll use @SLY{}’s Trace Dialog functionality. This is how we set it up: @enumerate @item first type @kbd{C-c C-t} on the function’s name, or enter that in the minibuffer prompt; @item now, open the Trace Dialog in a new window by typing @kbd{C-c T} (that’s a capital @code{T}). We should already see our traced function under the heading ``Traced specs''; @item thirdly, for good measure, let’s also trace the nearby function @code{SLY-COMPLETIONS::FLEX-SCORE} by also typing @kbd{C-c C-t} on its name, or just entering it in the minibuffer prompt. @end enumerate Now let’s return to the REPL by switching to its @code{*sly-mrepl ...} buffer or typing @kbd{C-c C-z}. In the REPL, let’s try to complete some typical Lisp string by typing just @code{desbind} and then typing @kbd{TAB}. We should see a window popup including the desired completion @code{destructuring-bind} (it should also be the top match). Of course, we could now select some completion from the list, but instead let's just type @kbd{C-g} to dismiss the @code{*sly-completions*} window, since we wanted to test completion, not write any actual @code{destructuring-bind} expression. Remember the traced functions in the Trace Dialog? Let’s see if we got any traces: let's type @kbd{C-c T} to switch to that buffer, and then type capital @kbd{G}. This should produce a fair number of traces organized in a call graph. @*@image{images/tutorial-3,350pt}@* We can later learn more about this mode (@pxref{Trace Dialog}), but for now let’s again pretend we expected the function @code{FLEX-SCORE} to return a wildly different score for @code{COMMON-LISP:DESTRUCTURING-BIND}. In that case we should like to witness said @code{FLEX-SCORE} function respond to any implementation improvements we perform. To do so, it's useful to be able to surgically re-run that function with those very same arguments. Let's do this by finding the function call in the Trace Dialog window, right-clicking it with the mouse and selecting ``Copy call to REPL''. As an alternative, pressing @kbd{M-S-RET} on it also works. Whichever way we do this, we are automatically transported to the REPL again, where the desired function call has already been typed out for us at the command prompt, awaiting a confirmation @kbd{RET}, which will run the function call. The call may look strange, though: @example ; The actual arguments passed to trace 15 "desbind" "COMMON-LISP:DESTRUCTURING-BIND" (12 13 14 26 27 28 29) SLYNK-COMPLETION> (slynk-completion::flex-score #v1:0 #v1:1 #v1:2) 0.003030303 (0.30303028%) SLYNK-COMPLETION> @end example @*@image{images/tutorial-4,350pt}@* So here’s what’s going on: to copy the call to the REPL, @SLY{} first copied over its actual arguments, and then wrote the function using special @emph{backreferences} to those arguments in the correct place. These are the @code{#v4:0} and @code{#v4:1} bits seen at the command prompt. Let’s go ahead and put the cursor on them (or hover the mouse). See how this makes them highlight the corresponding object a few lines above in the buffer? Later, you can also try typing ``#v'' at the REPL to incrementally write your own backreferences. For one final demonstration, let’s now suppose say we are still intrigued by how that function (@code{FLEX-SCORE}) works internally. So let's navigate to its definition using @kbd{M-.} again (or just open the @file{slynk-completion.lisp} buffer that you probably still have open). The function’s code might look like this: @example (defun flex-score (pattern string indexes) "Score the match of PATTERN on STRING. INDEXES as calculated by FLEX-MATCHES" ;; FIXME: hideously naive scoring (declare (ignore pattern)) (float (/ 1 (* (length string) (max 1 (reduce #'+ (loop for (a b) on indexes while b collect (- b a 1)))))))) @end example Can this function be working correctly? What do all those expressions return? Should we reach for good old C-style @code{printf}? Let's try ``stickers'' instead. SLY's stickers are a form of non-intrusive function instrumentation that work like carefully crafted @code{print} or @code{(format t ...)}), but are much easier to work with. You can later read more about them (@pxref{Stickers}), but for now you can just think of them as colorful labels placed on s-exp’s. Let’s place a bunch here, like this: @enumerate @item on the last line of @code{flex-score}, place your cursor on the first open parenthesis of that line (the opening parenthesis of the expression @code{(- b a 1)}) and press @kbd{C-c C-s C-s}; @item now do the same for the symbol @code{indexes} a couple of lines above; @item again, the same for the expressions @code{(loop...)}, @code{(reduce...)}, @code{(max...)}, @code{(length...)}, @code{(*...)}, @code{(/... )} and @code{(float...)}. You could have done this in any order, by the way; @end enumerate Now let’s recompile this definition with @kbd{C-c C-c}. Beside the minibuffer note something about stickers being ``armed'' our function should now look like a rainbow in blue. @*@image{images/tutorial-5,350pt}@* Now we return to the @SLY{} REPL, but this time let’s use @kbd{C-c ~} (that’s @kbd{C-c} followed by ``tilde'') to do so. This syncs the REPL’s local package and local directory to the Lisp file that we’re visiting. This is something not strictly necessary here but generally convenient when hacking on a system, because you can now call functions from the file you came from without package-qualification. Now, to re-run the newly instrumented function, by calling it with the same arguments. No need to type all that again, because this REPL supports reverse history i-search, remember? So just type the binding @kbd{C-r} and then type something like @kbd{scor} to search history backwards and arrive at the function call copied to the REPL earlier. Type @kbd{RET} once to confirm that's the call your after, and @kbd{RET} again to evaluate it. Because those @code{#v...} backreferences are still trained specifically on those very same function arguments, you can be sure that the function call is equivalent. We can now use the @kbd{C-c C-s C-r} to @emph{replay} the sticker recordings of this last function call. This is a kind of slow walk-through conducted in separate navigation window called @code{*sly-stickers-replay*} which pops up. There we can see the Lisp value(s) that each sticker @code{eval}’ed to each time (or a note if it exited non-locally). We can navigate recordings with @kbd{n} and @kbd{p}, and do the usual things allowed by interactive objects like inspecting them and returning them to the REPL. If you need help, toggle help by typing @kbd{h}. There are lots of options here for navigating stickers, ignoring some stickers, etc. When we’re done in this window, we press @kbd{q} to quit. @*@image{images/tutorial-6,350pt}@* Finally, we declare that we’re finished debugging @code{FLEX-MATCHES}. Even though stickers don’t get saved to the file in any way, we decide we’re not interested in them anymore. So let’s open the ``SLY'' menu in the menu bar, find the ``Delete stickers from top-level form'' option under the ``Stickers'' sub-menu, and click it. Alternatively, we could have typed @kbd{C-u C-c C-s C-s}. @node Working with source files @chapter Working with source files @SLY{}'s commands when editing a Lisp file are provided via @code{sly-editing-mode}, a minor-mode used in conjunction with Emacs's @code{lisp-mode}. This chapter describes @SLY{}’s commands for editing and working in Lisp source buffers. There are, of course, more @SLY{}’s commands that also apply to these buffers (@pxref{Common functionality}), but with very few exceptions these commands will always be run from a @code{.lisp} file. @menu * Evaluation:: * Compilation:: * Autodoc:: * Semantic indentation:: * Reader conditionals:: * Macro-expansion:: @end menu @node Evaluation @section Evaluating code 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 @kbd{C-u} inserts the results into the current buffer, while a negative prefix argument @kbd{M--} sends them to the kill ring. @table @kbd @kbditem{C-x C-e, sly-eval-last-expression} Evaluate the expression before point and show the result in the echo area. @kbditem{C-M-x, sly-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. @end table If @kbd{C-M-x} or @kbd{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. @table @kbd @kbditem{C-c :, sly-interactive-eval} Evaluate an expression read from the minibuffer. @kbditem{C-c C-r, sly-eval-region} Evaluate the region. @kbditem{C-c C-p, sly-pprint-eval-last-expression} Evaluate the expression before point and pretty-print the result in a fresh buffer. @kbditem{C-c E, sly-edit-value} Edit the value of a setf-able form in a new buffer @file{*Edit