With M-q
(aka fill-paragraph
), it is possible to format a single line of text nicely.
Is there a command or function which does a similar thing for lisps s-expressions?
It should break one-liner lisp expression where it is reasonable.
A command or function is searched.
I do not want a mode which is constantly formating the s-expressions.
Edit: Thanks to Drews comment I realized that fill-paragraph
does not get called by M-q
in paredit mode.
M-q
does work for sexps - it indents consistently, including indenting same-line comments etc. Its effects vary by programming language, though. But it does not split or join lines (that is typically a personal style decision, often on a case-by-case basis).M-q
.