In Emacs, how to reformat an edited paragraph so the line breaks are properly reinserted?
Solution 1:
You should use the fill-paragraph
command, normally bound to meta-q
. (You can use ESC q
if your keyboard doesn't have a meta key.) Paragraph filling only makes sense in free text modes or within comments in programming language modes. Programming language modes are usually setup around the TAB
key to properly indent lines; line breaks are inserted manually.
To set the column at which lines of text are broken, use the set-fill-column
command. Place the cursor at the column you want the line to end, and type control-u control-x f
and that column will become the fill column for the current buffer. Use fill-paragraph
to refill the paragraph with the new fill column.