[slime-devel] Re: macro indentation

Luke Gorrie luke at synap.se
Fri Dec 17 11:29:27 UTC 2004


Chris Capel <pdf23ds at gmail.com> writes:

> Consider
> 
> (defmacro deffoo (name bar baz &rest options) ...)
> 
> With this definition (or any definition using rest, really), this is
> the indentation you get:
> 
> (deffoo foo
>     bar
>   baz
>   opt1
>   opt2)
> 
> Shouldn't &rest be treated like &body as far as macroindentation is concerned?

No. IIUC the only difference between &rest and &body is that tools are
supposed to indent &body specially but not &rest. (I believe this is
discussed in the hyperspec.)

However, the indentation you're seeing in that example isn't
determined by slime but by Emacs itself. Emacs has builtin rules for
how to indent def* and with-* macros and by default SLIME won't
override them.

If you want SLIME to learn indentation for def* and with-* then you
can set `slime-conservative-indentation' to nil.

To see the intended behaviour take for example the indentation
arglist (mapcar f list &rest lists) vs. (with-foo foo &body body):

  (mapcar #'the-function-i-want-to-map
          my-first-list
          my-second-list)

  (with-foo my-foo
    (frob1)
    (frob2))

Cheers,
Luke





More information about the slime-devel mailing list