[slime-cvs] CVS slime/contrib

CVS User nsiivola nsiivola at common-lisp.net
Tue May 17 19:54:38 UTC 2011


Update of /project/slime/cvsroot/slime/contrib
In directory common-lisp.net:/tmp/cvs-serv12277/contrib

Modified Files:
	ChangeLog slime-cl-indent.el 
Log Message:
slime-indentation: fix indentation of function calls inside loop forms

  ...and add a test-case.


--- /project/slime/cvsroot/slime/contrib/ChangeLog	2011/05/16 07:59:18	1.454
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2011/05/17 19:54:38	1.455
@@ -1,3 +1,8 @@
+2011-05-17  Nikodemus Siivola  <nikodemus at random-state.net>
+
+	* slime-cl-indent.el (run-lisp-indent-tests, lisp-indent-loop): Fix
+	indentation of function calls, etc, inside loop forms.
+
 2011-05-16  Nikodemus Siivola  <nikodemus at random-state.net>
 
 	* slime-cl-indent.el (lisp-loop-indent-forms-like-keywords)
--- /project/slime/cvsroot/slime/contrib/slime-cl-indent.el	2011/05/16 08:23:45	1.21
+++ /project/slime/cvsroot/slime/contrib/slime-cl-indent.el	2011/05/17 19:54:38	1.22
@@ -690,10 +690,13 @@
        (error (+ sexp-column lisp-body-indent)))))
 
 (defun lisp-indent-loop (path state indent-point sexp-column normal-indent)
-  (if lisp-loop-indent-subclauses
-      (list (common-lisp-indent-loop-macro-1 state indent-point)
-            (common-lisp-indent-parse-state-start state))
-    (common-lisp-loop-part-indentation indent-point state)))
+  (cond ((not (null (cdr path)))
+         normal-indent)
+        (lisp-loop-indent-subclauses
+         (list (common-lisp-indent-loop-macro-1 state indent-point)
+               (common-lisp-indent-parse-state-start state)))
+        (t
+         (common-lisp-loop-part-indentation indent-point state))))
 
 ;;;; LOOP indentation, the complex version -- handles subclause indentation
 
@@ -1229,8 +1232,8 @@
          (print x)
          (print y)
          (print 'ok!))")
-      (((lisp-loop-indent-subclauses nil)
-        (lisp-loop-indent-forms-like-keywords nil))
+     (((lisp-loop-indent-subclauses nil)
+       (lisp-loop-indent-forms-like-keywords nil))
        "
    (loop for x in foo
          for y in quux
@@ -1251,7 +1254,22 @@
          do
             (print x)
             (print y)
-            (print 'ok!))"))))
+            (print 'ok!))")
+     (((lisp-loop-indent-subclauses nil)
+       (lisp-loop-indent-forms-like-keywords nil))
+       "
+   (loop for f in files
+         collect (open f
+                       :direction :output)
+         do (foo) (bar)
+            (quux))")
+      (((lisp-loop-indent-subclauses t))
+       "
+   (loop for f in files
+         collect (open f
+                       :direction :output)
+         do (foo) (bar)
+            (quux))"))))
 
 
 





More information about the slime-cvs mailing list