clojure-mode
clojure-mode copied to clipboard
Defining indentation specs for multi-arity functions
I have a function (function, not macro. But I don't think it matters) with the following signatures:
[request payoff right-body]
[request response-data payoff right-body]
[request response-data includes payoff & right-body]
The correct indentation for these would be to indent right-body as a 'body' parameter.
Given that the position of right-body in the arglist varies, one cannot use a fixed number for (put-clojure-indent ...)
.
Is this a known problem?
Intuitively, I'd want to express indentation as (put-clojure-indent 'my-fn :last)
, :last being the thing to implement.
(By the way I don't like the original function to begin with, but I shouldn't refactor other people's code just because I can't indent it)
Doesn't the defn
indentation work for your case?