branch: elpa/slime
commit 553258fbcd8968dfff81c745dae614d6975926ea
Author: MichaĆ "phoe" Herda <[email protected]>
Commit: Stas Boukarev <[email protected]>
Indent `("foo" ...) as data
Closes #904
---
contrib/slime-cl-indent.el | 7 ++++++-
contrib/test/slime-cl-indent-test.txt | 27 +++++++++++++++++++++++++++
2 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/contrib/slime-cl-indent.el b/contrib/slime-cl-indent.el
index 46cc7edca9..6325dffbc1 100644
--- a/contrib/slime-cl-indent.el
+++ b/contrib/slime-cl-indent.el
@@ -903,7 +903,12 @@ For example, the function `case' has an indent property
(cond ((and (or (eq (char-after (1- containing-sexp)) ?\')
(and (not lisp-backquote-indentation)
- (eq (char-after (1- containing-sexp)) ?\`)))
+ (eq (char-after (1- containing-sexp)) ?\`))
+ ;; `("foo" ...) is not valid Lisp, indent it as
data.
+ (save-excursion
+ (goto-char containing-sexp)
+ (backward-char)
+ (looking-at "`\\s-*\(\\s-*\\\"")))
(not (eq (char-after (- containing-sexp 2)) ?\#)))
;; No indentation for "'(...)" elements
(setq calculated (1+ sexp-column)))
diff --git a/contrib/test/slime-cl-indent-test.txt
b/contrib/test/slime-cl-indent-test.txt
index 71f8744e1c..9beb530366 100644
--- a/contrib/test/slime-cl-indent-test.txt
+++ b/contrib/test/slime-cl-indent-test.txt
@@ -1004,3 +1004,30 @@
(list foo
bar
baz))
+
+;;; Test: indent-96
+
+`("foo"
+ "bar")
+
+;;; Test: indent-97
+
+`("foo" "baz" "quux"
+ "bar" "frob")
+
+;;; Test: indent-98
+
+`("foo" ()
+ "bar" "baz" "quux")
+
+;;; Test: indent-99
+
+`( "foo" ()
+ "bar" "baz" "quux")
+
+;;; Test: indent-100
+
+`("foo" ()
+ ("bar" ())
+ ("baz" () "fred")
+ ("quux" ()))