Hello everyone 🙂 Is there an easy way to change the indentation of a user macro in clojure mode? I have code that looks something like this:
(|> 1
|> inc
|> inc)
But would like to have my indentation like so:
(|> 1
|> inc
|> inc)
Looking at https://github.com/clojure-emacs/clojure-mode#indentation-of-macro-forms it only seems that one can define indentation for built-in macros... but maybe I'm missing something?I think you can use something like:
(define-clojure-indent
(your-macro 'defun))
define-clojure-indent
is a elisp macro, that's why accepts anything that may be a clojure macro like your-macro
or
(define-clojure-indent
(your-macro 1))
Thank you for the response! Trying
(define-clojure-indent
(|> 'defun))
changed the indentation 🙂
Only problem is is that it's 1-off from being what I'd like it to be 😞
(|> N
|> inc
|> inc)
The way I want it is a weird case and I doubt much clojure code would be styled like that (and I am only doing it for fun).