technomancy/clojure-mode — pull request #54 by candera (2011-12-15 02:55:21+00:00)
Title: Add clojure-fill-docstring.

Docstring filling in clojure-mode/paredit suffers from two problems:

1) It sucks the arguments that follow the docstring onto the same line as the docstring
2) It doesn't put two spaces at the beginning of non-first lines in docstrings, which is how they look best when output via (doc)

The attached patch binds C-c M-q to clojure-fill-docstring, which fixes both of these shortcomings. Place point inside a docstring, hit C-c M-q, and the docstring will be filled with a left margin of 2 for every line but the first, and nothing outside the string boundaries will be affected, so the args stay right where they should be.

It's even possible to have text further indented by starting a docstring paragraph with an indent greater than 2 - that indent will be preserved in the remainder of that paragraph's lines.