[slime-cvs] CVS slime/contrib

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


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

Modified Files:
	ChangeLog slime-cl-indent.el 
Log Message:
slime-indentation: fix indentation of sublists in destructuring lambda-lists

  Simply apply the existing logic even if the path is not empty:

   (defmacro foo ((&optional o1
                             o2
                   &rest rest)
                  &body body)
    ...)

  instead of:

   (defmacro foo ((&optional o1
                             o2
                             &rest rest)
                  &body body)
     ...)


--- /project/slime/cvsroot/slime/contrib/ChangeLog	2011/05/15 17:20:33	1.447
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2011/05/15 17:21:11	1.448
@@ -7,6 +7,9 @@
 	of the sublist itself.
 	(lisp-indent-lambda-list-keywords-regexp): Add support for non-standard &more.
 	(test-lisp-indent, run-lisp-indent-tests): Rudimentary tests.
+	(lisp-indent-259): Use lambda-list-indentation even if the CDR of the path
+	isn't null: this allows correct indentation of destructuring sublists.
+	(run-lisp-indent-tests): More test-cases.
 
 2011-05-11  Nikodemus Siivola  <nikodemus at random-state.net>
 
--- /project/slime/cvsroot/slime/contrib/slime-cl-indent.el	2011/05/15 17:20:33	1.13
+++ /project/slime/cvsroot/slime/contrib/slime-cl-indent.el	2011/05/15 17:21:11	1.14
@@ -555,15 +555,13 @@
                  (throw 'exit
                    (cond ((null p)
                           (list (+ sexp-column 4) containing-form-start))
-                         ((null (cdr p))
+                         (t
                           ;; Indentation within a lambda-list. -- dvl
                           (list (lisp-indent-lambda-list
                                  indent-point
                                  sexp-column
                                  containing-form-start)
-                                containing-form-start))
-                         (t
-                          normal-indent))))
+                                containing-form-start)))))
                 ((integerp tem)
                  (throw 'exit
                    (if (null p)         ;not in subforms
@@ -1020,7 +1018,7 @@
                  &rest rest)
    (list foo opt1 opt2
          rest))")
-     (((lisp-lambda-list-keyword-parameter-alignment y)
+     (((lisp-lambda-list-keyword-parameter-alignment t)
        (lisp-lambda-list-keyword-alignment t))
       "
  (defun foo (foo &optional opt1
@@ -1028,6 +1026,38 @@
                  &rest rest)
    (list foo opt1 opt2
          rest))")
+     (((lisp-lambda-list-keyword-parameter-alignment nil)
+       (lisp-lambda-list-keyword-alignment nil))
+      "
+ (defmacro foo ((foo &optional opt1
+                       opt2
+                 &rest rest))
+   (list foo opt1 opt2
+         rest))")
+     (((lisp-lambda-list-keyword-parameter-alignment t)
+       (lisp-lambda-list-keyword-alignment nil))
+      "
+ (defmacro foo ((foo &optional opt1
+                               opt2
+                 &rest rest))
+   (list foo opt1 opt2
+         rest))")
+     (((lisp-lambda-list-keyword-parameter-alignment nil)
+       (lisp-lambda-list-keyword-alignment t))
+      "
+ (defmacro foo ((foo &optional opt1
+                       opt2
+                     &rest rest))
+   (list foo opt1 opt2
+         rest))")
+     (((lisp-lambda-list-keyword-parameter-alignment t)
+       (lisp-lambda-list-keyword-alignment t))
+      "
+ (defmacro foo ((foo &optional opt1
+                               opt2
+                     &rest rest))
+   (list foo opt1 opt2
+         rest))")
      "
   (let ((x y)
         (foo #-foo (no-foo)
@@ -1064,37 +1094,37 @@
            (exdented loop body)
            (I'm not sure I like this but it's compatible)
         when funny-predicate do ;; Here's a comment
-                                (body filled to comment))")))
+                                (body filled to comment))"
+     "
+  (defun foo (x)
+    (tagbody
+     foo
+       (bar)
+     baz
+       (when (losing)
+         (with-big-loser
+             (yow)
+           ((lambda ()
+              foo)
+            big)))
+       (flet ((foo (bar baz zap)
+                (zip))
+              (zot ()
+                quux))
+         (do ()
+             ((lose)
+              (foo 1))
+           (quux)
+          foo
+           (lose))
+         (cond ((x)
+                (win 1 2
+                     (foo)))
+               (t
+                (lose
+                 3))))))")))
 
 
-;(defun foo (x)
-;  (tagbody
-;   foo
-;     (bar)
-;   baz
-;     (when (losing)
-;       (with-big-loser
-;           (yow)
-;         ((lambda ()
-;            foo)
-;          big)))
-;     (flet ((foo (bar baz zap)
-;              (zip))
-;            (zot ()
-;              quux))
-;       (do ()
-;           ((lose)
-;            (foo 1))
-;         (quux)
-;        foo
-;         (lose))
-;       (cond ((x)
-;              (win 1 2
-;                   (foo)))
-;             (t
-;              (lose
-;                3))))))
-
 
 ;(put 'while    'common-lisp-indent-function 1)
 ;(put 'defwrapper'common-lisp-indent-function ...)





More information about the slime-cvs mailing list