[slime-cvs] CVS slime/contrib

CVS User nsiivola nsiivola at common-lisp.net
Fri Apr 13 16:16:11 UTC 2012


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

Modified Files:
	ChangeLog slime-cl-indent-test.txt slime-cl-indent.el 
Log Message:
slime-indentation: don't indent non-lists as if they were lambda-lists

  Not even if they appear where a lambda-list is expected.

  Makes TENTATIVE-DEFUN logic more correct for things like

     (define-foo name
       :option1 bar
       :option2 quux)

  which previously indented as

     (define-foo name
         :option1 bar
       :option2 quux)

  .


--- /project/slime/cvsroot/slime/contrib/ChangeLog	2012/04/13 16:15:40	1.544
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2012/04/13 16:16:11	1.545
@@ -1,5 +1,12 @@
 2012-04-13  Nikodemus Siivola  <nikodemus at random-state.net>
 
+	* slime-cl-indent.el (lisp-indent-259): If we are expecting a
+	lambda-list, but don't have a list in the position, indent as if
+	it was &body instead.
+	* slime-cl-indent-test.txt (Test 89-90): Tests.
+
+2012-04-13  Nikodemus Siivola  <nikodemus at random-state.net>
+
 	* slime-cl-indent.el (common-lisp-lambda-list-initial-value-form-p):
 	Handle &AUX as well, and don't signal an error if the we don't
 	have a list where expected.
--- /project/slime/cvsroot/slime/contrib/slime-cl-indent-test.txt	2012/04/13 16:15:40	1.21
+++ /project/slime/cvsroot/slime/contrib/slime-cl-indent-test.txt	2012/04/13 16:16:11	1.22
@@ -935,3 +935,15 @@
                                                :for 'foo)))))
   bar
   quux)
+
+;;; Test: 89
+
+(define-tentative-thing foo
+    (bar)
+  quux)
+
+;;; Test: 90
+
+(define-tentative-thing foo
+  bar
+  quux)
--- /project/slime/cvsroot/slime/contrib/slime-cl-indent.el	2012/04/13 16:15:40	1.66
+++ /project/slime/cvsroot/slime/contrib/slime-cl-indent.el	2012/04/13 16:16:11	1.67
@@ -1208,20 +1208,27 @@
                                 normal-indent
                               (list normal-indent containing-form-start))))
               ((eq tem '&lambda)
-               (if (common-lisp-lambda-list-initial-value-form-p indent-point)
-                   (throw 'exit (if (consp normal-indent)
-                                    normal-indent
-                                  (list normal-indent containing-form-start)))
-                 (throw 'exit
-                        (cond ((null p)
-                               (list (+ sexp-column 4) containing-form-start))
-                              (t
-                               ;; Indentation within a lambda-list. -- dvl
-                               (list (lisp-indent-lambda-list
-                                      indent-point
-                                      sexp-column
-                                      containing-form-start)
-                                     containing-form-start))))))
+               (throw 'exit
+                      (cond ((not (common-lisp-looking-back ")"))
+                             ;; If it's not a list at all, indent it
+                             ;; like body instead.
+                             (if (null p)
+                                 (+ sexp-column lisp-body-indent)
+                               normal-indent))
+                            ((common-lisp-lambda-list-initial-value-form-p
+                              indent-point)
+                             (if (consp normal-indent)
+                                 normal-indent
+                               (list normal-indent containing-form-start)))
+                            ((null p)
+                             (list (+ sexp-column 4) containing-form-start))
+                            (t
+                             ;; Indentation within a lambda-list. -- dvl
+                             (list (lisp-indent-lambda-list
+                                    indent-point
+                                    sexp-column
+                                    containing-form-start)
+                                   containing-form-start)))))
               ((integerp tem)
                (throw 'exit
                       (if (null p)         ;not in subforms





More information about the slime-cvs mailing list