-
-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Indentation of clojure.test/are
#548
Comments
I'd actually expect the clojure-mode result (not alignment, but two levels of indentation to separate it from the body). |
I'm not sure I understand what you mean. But it would be best if there was some way to configure this... |
Seems like it's not specific to
|
This change to modified clojure-mode.el
@@ -1511,7 +1511,8 @@ This function also returns nil meaning don't specify the indentation."
(clojure--normal-indent last-sexp 'always-align))
;; Special arg. Rigidly indent with a large indentation.
(t
- (+ (* 2 lisp-body-indent) containing-form-column)))))
+ (+ 1 (* 2 lisp-body-indent) containing-form-column)
+ ))))
(`:defn
(+ lisp-body-indent containing-form-column))
((pred functionp) Though I suspect a proper fix should take into account the value of
...and how 'ordinary function arguments' are indented is controlled by I'm not sure if In any case, with the provided patch:
|
hi @j-cr Thanks for posting this diff! I've tried the following process:
I've rolled back that diff and recompiled elpa. Everything seems to be working again but I was trying to fix this issue with
|
I don't use spacemacs so I don't know. Simply finding that function, changing it and evaluating it should work. |
@j-cr thanks! |
@joncol, svantevonerichsen6906 meant that this is correct formatting. Clojure mode indents special arguments by fixed amount of spaces, which is twice as large as indentation of ordinary macro parameter. Similarly, if you put (let
[a 10]
a) It may actually look that vector is aligned with where the first argument should go, but it's just a coincidence. If you use a longer macros like (foo-bar-baz a
b
c) Which helps seeing that patch in #548 (comment) introduces incorrect formatting, by making all special args indented by 5 spaces instead of 4, thus making those align with forms that have 3 letter long names, but it will still not work with |
Expected behavior
I was expecting
clojure-mode
's indentation to behave similar tocider-format
andlein cljfmt
. Is there some way to configureclojure-mode
to indent the same way ascider-format
?Actual behavior
The macro
clojure.test/are
is indented one way withM-x cider-format
(andlein cljfmt
), but another way when usingclojure-mode
's indentation rules (withaggressive-indent-mode
). The latter uses one space less than the former for the second argument toare
(when it is on a new line).Steps to reproduce the problem
The code is formatted as following using
clojure-mode
indentation:And as following when using
cider-format
indentation (note the extra space on line 3):Environment & Version information
clojure-mode version information
Emacs version
Operating system
Arch Linux
The text was updated successfully, but these errors were encountered: