Indenting and Pretty Printing a Sexpr

Over at the Emacs Stack Exchange, Jue asks if there’s something equivalent to fill-paragraph for S-expressions. Part of the problem is that paredit redefines Meta+q so fill-paragraph appears not to work.

It turns out, though, that there is a command specifically intended to reflow sexprs. That command is indent-pp-sexp, bound to Ctrl+Meta+q. It won’t break up lines but it will reindent them properly, something I, at least, often need. If you specify the universal argument, it will pretty print the sexpr, including breaking lines up and properly indenting the expression.

This entry was posted in General and tagged . Bookmark the permalink.