From 16b507d71e0600cbfb4d34b41ccf097079eaa655 Mon Sep 17 00:00:00 2001 From: bpoweski Date: Sun, 26 Jun 2016 16:41:41 -0500 Subject: [PATCH] Fix multi-airty indention of deftype & defrecord (#389) --- clojure-mode.el | 4 ++-- test/clojure-mode-indentation-test.el | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/clojure-mode.el b/clojure-mode.el index d7e1564c..7c050a04 100644 --- a/clojure-mode.el +++ b/clojure-mode.el @@ -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)) diff --git a/test/clojure-mode-indentation-test.el b/test/clojure-mode-indentation-test.el index 7fcc9389..fbdb5f41 100644 --- a/test/clojure-mode-indentation-test.el +++ b/test/clojure-mode-indentation-test.el @@ -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] @@ -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))