Fill and unfill paragraphs with a single key31 May 2016, by Artur Malabarba.
fill-paragraph is probably among the most underappreciated Emacs commands. I
use it dozens of times a day, and never stop to think of just how awesome and
practical it is. Still, we can make it a little bit better. Every once in a
while I need to “unfill” (or “unwrap”) a paragraph that’s broken over many
By being clever enough, we can make this into a free feature. There’s never any reason to hit M-q twice on the same paragraph, so we can use that as our keybind for the “unfill” command.
With this, M-q will act as a toggle. Hitting it once will do its usual thing (even if the paragraph is already filled), but hitting it twice will completely unwrap the current paragraph into a single line.