Skip to content
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

Fix multi-airty indention of deftype & defrecord (#389) #390

Merged
merged 1 commit into from
Jun 27, 2016
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## master (unreleased)

### Bugs fixed

* [#389](https://github.com/clojure-emacs/clojure-mode/issues/389): Fixed the indentation of `defrecord` and `deftype` multiple airity protocol forms.

## 5.5.0 (2016-06-25)

### New features
Expand Down
4 changes: 2 additions & 2 deletions clojure-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -1313,8 +1313,8 @@ work). To set it from Lisp code, use
(as-> 2)

(reify '(:defn (1)))
(deftype '(2 nil nil (1)))
(defrecord '(2 nil nil (1)))
(deftype '(2 nil nil (:defn)))
(defrecord '(2 nil nil (:defn)))
(defprotocol '(1 (:defn)))
(extend 1)
(extend-protocol '(1 :defn))
Expand Down
18 changes: 18 additions & 0 deletions test/clojure-mode-indentation-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,15 @@ values of customisable variables."
([item a]
(* a (:qty item)))))")

(def-full-indent-test deftype-allow-multiarity
"(deftype Banana []
Fruit
(subtotal
([item]
(* 158 (:qty item)))
([item a]
(* a (:qty item)))))")

(def-full-indent-test defprotocol
"(defprotocol IFoo
(foo [this]
Expand Down Expand Up @@ -326,6 +335,15 @@ values of customisable variables."
SomeType (assoc [_ x]
(.assoc pretty x 10)))")

(def-full-indent-test defrecord-allow-multiarity
"(defrecord Banana []
Fruit
(subtotal
([item]
(* 158 (:qty item)))
([item a]
(* a (:qty item)))))")

(def-full-indent-test letfn
"(letfn [(f [x]
(* x 2))
Expand Down