## Slime

Requires ECL threads.

This should work with any Slime version that plays together with ECL.

### Prepare

- Add to your `~/.emacs` file:

      (add-to-list 'load-path "~/slime/") ; slime path
      (require 'slime)
      (slime-setup '(slime-fancy))

- Add to your `~/.swank.lisp` file (or copy file `eql5/slime/.swank.lisp` in your home directory):
  (Please note: this isn't really optional -- you need to set this option for a useful Slime + EQL.)

      (setf swank:*globally-redirect-io* t) ; show print output in Emacs

- Copy file `~/.eql5/slime/eql-start-swank.lisp` in your `slime/` directory

- Optionally:
  In order to indent `qlet` correctly, edit your `slime/contrib/slime-cl-indent.el` file and add a line:

      (let* (as let)) ; already there
      (qlet (as let)) ; new

### Run

- Run the swank server (the command line option `-slime` can be omitted if the file name contains "start-swank"), optionally passing a Lisp file:

      eql5 <path-to-slime>/eql-start-swank.lisp [file.lisp]

- Please note (e.g. for MinGW): if you can't connect from Emacs to Slime, try to start swank detached from the console (final &):

      eql5 <path-to-slime>/eql-start-swank.lisp [file.lisp] &

- Run Emacs and do: `Meta-X slime-connect` (please note: use `slime-connect`) and hit `Return` 2 times (confirming the default values).

  Please note: if `:dont-close` is set to `T` in `eql-start-swank.lisp`, quitting/restarting Emacs will not affect a running EQL program, that is: if you quit/restart Emacs, you can connect to the same swank/EQL you left when quitting Emacs.

### Loading files

You should always use `qload` instead of `load`, if the file contains any EQL code.

It's not strictly necessary in every case, but not doing so may result in slow loading (many thread switches, for each EQL function call), or may not even work (e.g. if the loaded code uses Qt threads internally).

### Help

For help see the `qapropos`, `qfind-bound`, `qproperties` and `qgui` functions.

To kill the swank process (Slime), use function `qquit` / `qq` (since quitting Emacs will not kill it).

### Notes

If you notice slow execution of a function called from the REPL, try to wrap it in `qrun`/`qrun*`, as this will reduce eventual, multiple thread switches (for each EQL function call) to a single one.

All EQL functions are wrapped in `qrun*` (see `lib/thread-safe.lisp`), so it's safe to call them either directly from the REPL or using 'eval region' (or from any other ECL thread).

If the Slime REPL hangs, you can simply try to connect again (losing the old connection): no need to restart Lisp.

This Slime mode is both convenient and simple to use, but conses a little more for every EQL function call.
If you absolutely want direct EQL function calls, please see the less convenient Slime REPL Hook mode.

How does it work?