Hi,
I would like to know how to fix easily (if possible) some indentation
problems with SLIME (latest SLIME & gentoo linux x86) - for example
"with-accessors" :
(defun create-state (type g-1 g-2 &key (node-comparator nil)
(edge-comparator nil) (sort-nodes nil))
(let ((state
(make-instance type
:node-compatible (or node-comparator (lambda (x y) (declare (ignore
x y)) t))
:edge-compatible (or edge-comparator (lambda (x y) (declare (ignore
x y)) t))
:ssr-1 (make-array (nodes-count-of g-1) :fill-pointer 0)
:ssr-2 (make-array (nodes-count-of g-2) :fill-pointer 0)
:graph-1 g-1 :node-count-1 (nodes-count-of g-1)
:graph-2 g-2 :node-count-2 (nodes-count-of g-2)
:order (if sort-nodes (sort-nodes-by-frequency g-1) nil))))
(with-accessors ((ssr-1 ssr-1-of) (ssr-2 ssr-2-of)) state
(dotimes (i (nodes-count-of g-1))
(vector-push (make-ssr-block :core +null-node+ :in 0 :out 0)
(ssr-1-of state)))
(dotimes (i (nodes-count-of g-2))
(vector-push (make-ssr-block :core +null-node+ :in 0 :out 0)
(ssr-2-of state))))
state))
Why is the body of with-accessors shifted so much to the right?
with-slots is ok.
Then - I sometimes use some macros like dovector and such, and the body
is again shifted
under the left opening paren for arguments - which is too much to the
right, and the code looks
confusing, since the shape is invalid.
Anybody had some similar problems and fixes?
Thanks,
Karol
Karol Skocik wrote:
> Hi,
> I would like to know how to fix easily (if possible) some indentation
> problems with SLIME (latest SLIME & gentoo linux x86) - for example
> "with-accessors" :
>
> [...]
>
> Why is the body of with-accessors shifted so much to the right? [...]
>
> Anybody had some similar problems and fixes?
Though I suppose that this question is technically more appropriate for
something like comp.emacs, I've got the following in my emacs init file:
(put 'with-accessors 'common-lisp-indent-function 2)
I think this would do the trick for you, too.