Skip to content

Commit f24c536

Browse files
bpoweskibbatsov
authored andcommitted
Fix multi-airty indention of deftype & defrecord (#389) (#390)
1 parent 6d0dea4 commit f24c536

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## master (unreleased)
44

5+
### Bugs fixed
6+
7+
* [#389](https://github.com/clojure-emacs/clojure-mode/issues/389): Fixed the indentation of `defrecord` and `deftype` multiple airity protocol forms.
8+
59
## 5.5.0 (2016-06-25)
610

711
### New features

clojure-mode.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,8 +1313,8 @@ work). To set it from Lisp code, use
13131313
(as-> 2)
13141314

13151315
(reify '(:defn (1)))
1316-
(deftype '(2 nil nil (1)))
1317-
(defrecord '(2 nil nil (1)))
1316+
(deftype '(2 nil nil (:defn)))
1317+
(defrecord '(2 nil nil (:defn)))
13181318
(defprotocol '(1 (:defn)))
13191319
(extend 1)
13201320
(extend-protocol '(1 :defn))

test/clojure-mode-indentation-test.el

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,15 @@ values of customisable variables."
280280
([item a]
281281
(* a (:qty item)))))")
282282

283+
(def-full-indent-test deftype-allow-multiarity
284+
"(deftype Banana []
285+
Fruit
286+
(subtotal
287+
([item]
288+
(* 158 (:qty item)))
289+
([item a]
290+
(* a (:qty item)))))")
291+
283292
(def-full-indent-test defprotocol
284293
"(defprotocol IFoo
285294
(foo [this]
@@ -326,6 +335,15 @@ values of customisable variables."
326335
SomeType (assoc [_ x]
327336
(.assoc pretty x 10)))")
328337

338+
(def-full-indent-test defrecord-allow-multiarity
339+
"(defrecord Banana []
340+
Fruit
341+
(subtotal
342+
([item]
343+
(* 158 (:qty item)))
344+
([item a]
345+
(* a (:qty item)))))")
346+
329347
(def-full-indent-test letfn
330348
"(letfn [(f [x]
331349
(* x 2))

0 commit comments

Comments
 (0)