Emacs fill-paragraph Problem

By Xah Lee. Date: . Last updated: .

Emacs has a command fill-paragraphAlt+q】 that does hard-wrap of current paragraph (it inserts a newline char at every ~70 chars.) Emacs also has fill-region, which acts on a text selection. However, there are some usability problems with these commands. This page discuss the problems and fixes.

One frequently asked question is how to “unfill” — do inverse of fill-paragraph. Technically, this means replacing newline char by space. Emacs does not have a built-in command for this. The typical answer to this question, is to set the cut-width to a huge number (For example, set fill-column to 10001000), then Alt+x fill-paragraph, then set fill-column back to previous value. This is inconvenient.

If you need to reformat several paragraphs, Alt+x fill-region. There is no keyboard shortcut.

Auto Toggle Fill/Unfill/Region

Emacs Modernization