[slime-cvs] CVS slime/contrib

CVS User nsiivola nsiivola at common-lisp.net
Sun May 15 17:11:25 UTC 2011


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

Modified Files:
	ChangeLog slime-cl-indent.el 
Log Message:
slime-indentation: make indent-sexp work properly for loop indentation

  Prior to this indent-sexp didn't indent loops properly, but simply
  aligned all lines of the loop body.

  common-lisp-loop-part-indentation needs to return a list of

    (<indent> <loop-start>)

  to let calculate-lisp-indent know that the following lines might have a
  different indentation.


--- /project/slime/cvsroot/slime/contrib/ChangeLog	2011/05/15 17:10:13	1.439
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2011/05/15 17:11:25	1.440
@@ -1,5 +1,13 @@
 2011-05-10  Nikodemus Siivola  <nikodemus at random-state.net>
 
+	* slime-cl-indent.el (common-lisp-loop-part-indentation): Return
+	(<indent> <loop-start>) instead of <indent> for non-simple loops.
+	This lets calculate-lisp-indent know that the following lines of
+	the loop might be indented differently -- fixing indent-sexp for
+	loops.
+
+2011-05-10  Nikodemus Siivola  <nikodemus at random-state.net>
+
 	* slime-cl-indent.el (common-lisp-indent-function-1): Remove
 	bogus special casing of ,(...) and ,@(...). Even if backquote
 	was being indented as data, the escaped forms are evaluated,
--- /project/slime/cvsroot/slime/contrib/slime-cl-indent.el	2011/05/15 17:10:13	1.5
+++ /project/slime/cvsroot/slime/contrib/slime-cl-indent.el	2011/05/15 17:11:25	1.6
@@ -149,20 +149,20 @@
 	(looking-at "\\sw"))
     (error t)))
 
-
 (defun common-lisp-loop-part-indentation (indent-point state)
   "Compute the indentation of loop form constituents."
-  (let* ((loop-indentation (save-excursion
-			     (goto-char (elt state 1))
+  (let* ((loop-start (elt state 1))
+         (loop-indentation (save-excursion
+			     (goto-char loop-start)
 			     (current-column))))
     (goto-char indent-point)
     (beginning-of-line)
-    (cond ((not (extended-loop-p (elt state 1)))
-	   (+ loop-indentation lisp-simple-loop-indentation))
-	  ((looking-at "^\\s-*\\(:?\\sw+\\|;\\)")
-	   (+ loop-indentation lisp-loop-keyword-indentation))
-	  (t
-	   (+ loop-indentation lisp-loop-forms-indentation)))))
+    (cond ((not (extended-loop-p loop-start))
+           (+ loop-indentation lisp-simple-loop-indentation))
+          ((looking-at "^\\s-*\\(:?\\sw+\\|;\\)")
+           (list (+ loop-indentation lisp-loop-keyword-indentation) loop-start))
+          (t
+           (list (+ loop-indentation lisp-loop-forms-indentation) loop-start)))))
 
 
 ;;;###autoload





More information about the slime-cvs mailing list