[slime-devel] controlling indentation of let forms

Helmut Eller heller at common-lisp.net
Mon Jul 11 17:25:07 UTC 2005


ramb at sonic.net writes:

> Is it possible to change how slime (is slime controlling the
> ident process??) indents let forms?

The lisp-indent-function does the indentation and SLIME is not quite
responsible for the indentation (or syntax highlighting).  SLIME gives
the indentation code some hints about macros with &body arguments, but
only if there isn't already some other rule.

The idea is that SLIME does only the stuff which needs interaction
with the external Lisp process.

> I prefer a let to look like this:
>
> (let (var1 var2 var3 var4
>       var5 var6)
>  ...)
>
>
> but its currently indented like this:
>
> (let (var1 var2 var3 var4
>            var5 var6)
>  ...)
>
> Can I change this? Or is slime the wrong place to look?

If your lisp-indent-function is set to common-lisp-indent-function you
could try something like:

  (put 'let 'common-lisp-indent-function '(&lambda &body))

If you use another indent-function you may need other parameters.
For very complicated syntax, like loop, you may also specify your own
function like:

  (put 'let 'common-lisp-indent-function 'my-indent-fun)

Helmut.



More information about the slime-devel mailing list