[slime-cvs] CVS slime/contrib
CVS User nsiivola
nsiivola at common-lisp.net
Fri Jun 10 17:13:04 UTC 2011
Update of /project/slime/cvsroot/slime/contrib
In directory common-lisp.net:/tmp/cvs-serv13461/contrib
Modified Files:
ChangeLog slime-cl-indent-test.txt slime-cl-indent.el
Log Message:
slime-indentation: fix , and ,@ at the start of the indentation
Use the first comma as the basis.
--- /project/slime/cvsroot/slime/contrib/ChangeLog 2011/06/10 16:13:29 1.474
+++ /project/slime/cvsroot/slime/contrib/ChangeLog 2011/06/10 17:13:04 1.475
@@ -1,5 +1,12 @@
2011-06-10 Nikodemus Siivola <nikodemus at random-state.net>
+ Take , and ,@ into account properly.
+
+ * slime-cl-indent.el (common-lisp-indent-function-1): Adjust
+ normal-indent to take , and ,@ into account
+
+ * slime-cl-indent-test.txt: Test case 36-38.
+
Better handling of complex indentation specs.
* slime-cl-indent.el (common-lisp-run-indentation-tests): Add
--- /project/slime/cvsroot/slime/contrib/slime-cl-indent-test.txt 2011/06/10 16:13:29 1.3
+++ /project/slime/cvsroot/slime/contrib/slime-cl-indent-test.txt 2011/06/10 17:13:04 1.4
@@ -395,3 +395,28 @@
(bodyform)
(another))
+;;; Test: 36
+
+(defmacro foo (body)
+ `(let (,@(stuff)
+ ,(more-stuff)
+ ,(even-more)
+ (foo foo))
+ , at bofy))
+
+;;; Test: 37
+
+(defun foo ()
+ `(list foo bar
+ ,@(quux fo
+ foo)))
+
+;;; Test: 38
+
+(defmacro foofoo (body)
+ `(foo
+ `(let (,',@,(stuff)
+ ,(more-stuff)
+ ,(even-more)
+ (foo foo))
+ , at bofy)))
--- /project/slime/cvsroot/slime/contrib/slime-cl-indent.el 2011/06/10 16:13:29 1.37
+++ /project/slime/cvsroot/slime/contrib/slime-cl-indent.el 2011/06/10 17:13:04 1.38
@@ -661,6 +661,10 @@
(common-lisp-indent-function-1 indent-point state))
(defun common-lisp-indent-function-1 (indent-point state)
+ ;; If we're looking at a splice, move to the first comma.
+ (when (or (looking-back ",") (looking-back ",@"))
+ (when (re-search-backward "[^,@'],")
+ (forward-char 1))
(let ((normal-indent (current-column)))
;; Walk up list levels until we see something
;; which does special things with subforms.
More information about the slime-cvs
mailing list