[slime-cvs] CVS slime/contrib

CVS User nsiivola nsiivola at common-lisp.net
Wed Jun 8 20:44:19 UTC 2011


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

Modified Files:
	ChangeLog slime-cl-indent.el 
Log Message:
slime-indentation: fallback method for trailing expressions on prev line

  Emacs' calculate-lisp-indent doesn't indent

    (foo (or x
             y) t
         z)

  right, but would align Z with Y. Add a fallback method to deal with that.


--- /project/slime/cvsroot/slime/contrib/ChangeLog	2011/06/04 18:20:15	1.464
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2011/06/08 20:44:18	1.465
@@ -1,3 +1,8 @@
+2011-06-08  Nikodemus Siivola  <nikodemus at random-state.net>
+
+	* slime-cl-indent.el (common-lisp-indent-function-1): fallback
+	method to deal with trailing expressions on the previous line.
+
 2011-06-04  Nikodemus Siivola  <nikodemus at random-state.net>
 
 	* slime-cl-indent.el (toplevel):
--- /project/slime/cvsroot/slime/contrib/slime-cl-indent.el	2011/06/04 18:20:15	1.26
+++ /project/slime/cvsroot/slime/contrib/slime-cl-indent.el	2011/06/08 20:44:18	1.27
@@ -460,8 +460,21 @@
             (condition-case ()
                 (progn (backward-up-list 1)
                        (setq depth (1+ depth)))
-              (error (setq depth lisp-indent-maximum-backtracking))))))
-      (or calculated tentative-calculated))))
+              (error
+               (setq depth lisp-indent-maximum-backtracking))))))
+      (or calculated tentative-calculated
+          ;; Fallback. calculate-lisp-indent doesn't deal with
+          ;; things like (foo (or x
+          ;;                      y) t
+          ;;                  z)
+          ;; but would align the Z with Y.
+          (ignore-errors
+            (save-excursion
+              (goto-char containing-sexp)
+              (down-list)
+              (forward-sexp 2)
+              (backward-sexp)
+              (current-column)))))))
 
 
 (defun common-lisp-indent-call-method (function method path state indent-point
@@ -1378,7 +1391,7 @@
          (lisp-lambda-list-keyword-alignment t))
         "
      (destructuring-bind (foo &optional x
-                                        y 
+                                        y
                               &key bar
                                    quux)
          foo
@@ -1390,7 +1403,12 @@
          (x &optional y
                       z
             &rest more)
-       body)"))))
+       body)")
+       "
+     (foo fii
+          (or x
+              y) t
+          bar)")))
 
 
 





More information about the slime-cvs mailing list