Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* [#709](https://github.com/clojure-emacs/clojure-mode/pull/709): Give `extend-protocol`, `extend-type`, `specify` and `specify!` the `((:block 1) (:inner 1))` indent spec that `clojure-ts-mode` and cljfmt use, instead of an `(:inner 0)` rule that only worked because of how it was converted to the legacy format (specs copied from it need `(:inner 1)` too).
* [#709](https://github.com/clojure-emacs/clojure-mode/pull/709): Indent `fdef` like cljfmt does, as `((:inner 0))`, and list `let*` in the built-in indent specs, so that `clojure-get-indent-spec` returns its spec.
* [#709](https://github.com/clojure-emacs/clojure-mode/pull/709): Add the indent specs that cljfmt and `clojure-ts-mode` have and `clojure-mode` lacked, which indents the bodies of `match` and `struct-map`, and the bindings of `with-open`, `with-redefs` and the like as special arguments.
* [#710](https://github.com/clojure-emacs/clojure-mode/pull/710): Drop the indent specs of `async`, `this-as` and core.logic's `run`, `run*` and `fresh`, which cljfmt and `clojure-ts-mode` don't have, so they're indented like function calls now (`put-clojure-indent` brings them back).

### Bugs fixed

Expand Down
7 changes: 0 additions & 7 deletions clojure-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -2257,7 +2257,6 @@ work). To set it from Lisp code, use
(if-let '((:block 1)))
(when-some '((:block 1)))
(if-some '((:block 1)))
(this-as '((:block 1))) ; ClojureScript

(defmethod '((:inner 0)))

Expand All @@ -2266,12 +2265,6 @@ work). To set it from Lisp code, use
(deftest '((:inner 0)))
(are '((:block 2)))
(use-fixtures '((:inner 0)))
(async '((:block 1)))

;; core.logic
(run '((:inner 0)))
(run* '((:inner 0)))
(fresh '((:inner 0)))

;; core.match
(match '((:block 1)))
Expand Down
26 changes: 4 additions & 22 deletions test/clojure-mode-indentation-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -798,11 +798,6 @@ DESCRIPTION is a string with the description of the spec."
my-fn
:args (s/cat :x int?))")

(when-indenting-it "should handle this-as"
"
(this-as self
(.method self))")

;; clojure.test
(when-indenting-it "should handle testing"
"
Expand All @@ -825,28 +820,15 @@ DESCRIPTION is a string with the description of the spec."
(use-fixtures :each
my-fixture)")

(when-indenting-it "should handle async"
(when-indenting-it "should indent async and run* like function calls"
"
(async done
(do-stuff)
(done))")

;; core.logic
(when-indenting-it "should handle run"
"
(run [q]
(== q 1))")
(do-stuff)
(done))"

(when-indenting-it "should handle run*"
"
(run* [q]
(== q 1))")

(when-indenting-it "should handle fresh"
"
(fresh [a b]
(== a 1)
(== b 2))")
(== q 1))")

;; core.async
(when-indenting-it "should handle go"
Expand Down
Loading