Fork me on GitHub
#emacs
<
2021-05-01
>
borkdude14:05:10

Which clojure emacs tool can align EDN files like this: https://gist.github.com/mikeananev/c87c1596aed50b7bb095a816f6921737 So the vals on the right are aligned on the same column?

practicalli-johnny15:05:21

I thought it was just setting options in clojure-mode, one or both of these?

clojure-indent-style 'align-arguments                
clojure-align-forms-automatically t

dakra17:05:35

I think the command to manually format like that is clojure-align (Bound to C-c SPC by default)

yes 3
borkdude19:05:44

I have tried that but it doesn't seem to align all the keys and values in one map at the same column. I expect the vals from :enter and :leave to go more to the right because of the following key/val Am I misunderstanding how it should work?

dpsutton19:05:40

I think the line breaks introduce new alignments. So that if you have long keys you can put a line break so that other keys don’t get crazy indentation

dpsutton19:05:46

It might be configurable

dpsutton19:05:13

(defcustom clojure-align-separator clojure--align-separator-newline-regexp
  "The separator that will be passed to `align-region' when performing vertical alignment."
  :package-version '(clojure-mode . "5.10")
  :type `(choice (const :tag "Make blank lines prevent vertical alignment from happening."
                        ,clojure--align-separator-newline-regexp)
                 (other :tag "Allow blank lines to happen within a vertically-aligned expression."
                        'entire)))