Fork me on GitHub
#cider
<
2016-09-18
>
adamfrey17:09:02

In clojure-mode is there a way for me to set one specific form to have an indentation where the args are vertically aligned? I want the arguments to be aligned just for and and or.

jfntn19:09:42

@adamfrey you can probably do that with define-clojure-indent

adamfrey19:09:23

that’s what I want but I only see examples define-clojure-indent taking an int number of spaces to ident

adamfrey19:09:38

is there an option like :align or something?

jfntn19:09:14

I don’t understand what you want, have an example?

richiardiandrea19:09:43

@adamfrey there is clojure-align in clojure-mode

adamfrey19:09:07

@richiardiandrea what is clojure-align?

richiardiandrea19:09:31

(if I understood your request correctly) it aligns forms vertically

adamfrey19:09:57

yes, but I don’t want to align all forms vertically by default. I want all my function parameters to indent two spaces by default (which I already have set up and working). I only want to override that setting for two forms: and and or

adamfrey19:09:57

I feel like I should be able to do that with define-clojure-indent, but I can’t find an example of overriding just one form to make the params align.

richiardiandrea19:09:15

oh so I think definitely ⁠⁠⁠⁠define-clojure-indent should help

adamfrey19:09:54

@richiardiandrea thanks for the link! it made me realize that I misunderstood what the integer in define-clojure-indent meant. I thought it was the number of spaces to indent, but actually it is the amount of parameters to treat as “special”. So to get what I want I added this:

(define-clojure-indent
  (or 0)
  (and 0))