joaotavora / sly

Sylvester the Cat's Common Lisp IDE
1.23k stars 139 forks source link

Improper indenting of code after loop subclause "do" #622

Closed oreodave closed 1 month ago

oreodave commented 8 months ago

Hi all, Perhaps this is my misunderstanding but sly seems to indent code after the do subclause in a loop weirdly.

(loop for x from 0 to 10
      do
         (format t "~d~%" x))

Should code after a do be indented like this? The collect keyword seems to indent as I expect, for comparison:

(loop for x from 0 to 10
      collect
      (format nil "~d" x))

I'd just like to thank everyone who has worked on this project, it makes common lisp programming a breeze. Thanks in advance!

System details (in case that matters) GNU Emacs 29.1.50 (Development version 2123964ad139 on emacs-29 branch) SBCL 2.3.8 SLY 1.0.43
oreodave commented 1 month ago

Found this variable sly-lisp-loop-body-forms-indentation which adjusts the indentation of body forms. By setting this to 0 I get the behavior I want. If I'd just read the source code earlier I could've figured this out pretty quickly lol