[slime-cvs] CVS slime/contrib

CVS User nsiivola nsiivola at common-lisp.net
Tue Jun 14 10:26:28 UTC 2011


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

Modified Files:
	ChangeLog slime-cl-indent-test.txt slime-cl-indent.el 
Log Message:
slime-indentation: don't consider DEFINER and DEFINITION to be defun-like

  They're normally not.


--- /project/slime/cvsroot/slime/contrib/ChangeLog	2011/06/14 09:33:39	1.481
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2011/06/14 10:26:28	1.482
@@ -1,5 +1,14 @@
 2011-06-14  Nikodemus Siivola  <nikodemus at random-state.net>
 
+	Don't consider DEFINER and DEFINITION as tentative defuns.
+
+	* slime-cl-indent.el (common-lisp-indent-function-1): Don't consider
+	"definition" or "definer" to be tentative defuns.
+
+	* slime-cl-indent-test.txt: Tests 44-45.
+
+	Better DEFMETHOD and :METHOD indentation.
+
 	* slime-cl-indent.el (lisp-beginning-of-defmethod): New function.
 	(lisp-indent-defmethod): Extend to work with non-toplevel defmethods,
 	and method definitions inside defgenerics.
--- /project/slime/cvsroot/slime/contrib/slime-cl-indent-test.txt	2011/06/14 09:33:39	1.6
+++ /project/slime/cvsroot/slime/contrib/slime-cl-indent-test.txt	2011/06/14 10:26:28	1.7
@@ -475,3 +475,19 @@
   (:method (x y &optional a
                           b)
     (list x y a b)))
+
+;;; Test: 44
+
+(let (definer
+      foo
+      bar
+      quux)
+  ...)
+
+;;; Test: 45
+
+(let (definition
+      foo
+      bar
+      quux)
+  ...)
--- /project/slime/cvsroot/slime/contrib/slime-cl-indent.el	2011/06/14 09:33:39	1.44
+++ /project/slime/cvsroot/slime/contrib/slime-cl-indent.el	2011/06/14 10:26:28	1.45
@@ -776,24 +776,21 @@
                            (error nil))))
               (setq path (cons n path)))
 
-            ;; backwards compatibility.
-            (cond ((null function))
-                  ((null method)
-                   (when (null (cdr path))
-                     ;; (package prefix was stripped off above)
-                     (cond ((and (string-match "\\`def" function)
-                                 (not (string-match "\\`default" function)))
-                            (setq tentative-defun t))
-                           ((string-match
-                             (eval-when-compile
-                              (concat "\\`\\("
-                                      (regexp-opt '("with" "without" "do"))
-                                      "\\)-"))
-                             function)
-                            (setq method '(&lambda &body))))))
-                  ;; backwards compatibility.  Bletch.
-                  ((eq method 'defun)
-                   (setq method lisp-indent-defun-method)))
+            ;; Guess.
+            (when (and (not method) function (null (cdr path)))
+              ;; (package prefix was stripped off above)
+              (cond ((and (string-match "\\`def" function)
+                          (not (string-match "\\`default" function))
+                          (not (string-match "\\`definition" function))
+                          (not (string-match "\\`definer" function)))
+                     (setq tentative-defun t))
+                    ((string-match
+                      (eval-when-compile
+                        (concat "\\`\\("
+                                (regexp-opt '("with" "without" "do"))
+                                "\\)-"))
+                      function)
+                     (setq method '(&lambda &body)))))
 
             (cond ((and (or (eq (char-after (1- containing-sexp)) ?\')
                             (and (not lisp-backquote-indentation)





More information about the slime-cvs mailing list