neil-lindquist / lisp-paredit

Paredit for Atom
MIT License
24 stars 5 forks source link

Enhancement for keywords #36

Closed commander-trashdin closed 4 years ago

commander-trashdin commented 5 years ago

Changing

   (loop :for i :from 0 :below n
      :when (oddp i)
      :do (format t "~a is odd, " i)
      (funcall do-something-else i))```

to

 (loop :for i :from 0 :below n
       :when (oddp i)
       :do (format t "~a is odd, " i)
           (funcall do-something-else i))
observant2 commented 5 years ago

Also this:

(defmethod check-collisions ()
  (run-system (((pos 'c-position)
                (col 'c-collision)))
              (let ((shapes (c-collision-collision-shapes col)))
                (dolist (s shapes)
                        (cond ((typep s 'circle) (bla))
                          ((typep s 'box) (blub)))))))

The let form could be indented less, but especially the cond cases should be aligned properly.

observant2 commented 5 years ago

Okay, now looking into it, I found a solution to the problem I'm facing. I removed cond from the indentation forms in paredit's settings. Also I added dolist there. My code looks much better now. Maybe you should have a look at that list, too.

neil-lindquist commented 4 years ago

I added a note to the README about the Indentation forms.

neil-lindquist commented 4 years ago

For more advanced indentation work, I opened #38. Swank provides a bunch of information on how to indent correctly (or close there to), but it needs to be setup in a way that can be accessed by the indenter.

I'm going to close this unless there are specific issues that can be fixed seperately to issue #38 .