clojure-mode icon indicating copy to clipboard operation
clojure-mode copied to clipboard

Defining indentation specs for multi-arity functions

Open vemv opened this issue 5 years ago • 1 comments

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)

vemv avatar Dec 20 '18 21:12 vemv

Doesn't the defn indentation work for your case?

bbatsov avatar Jan 05 '19 17:01 bbatsov