Next: Fill Prefix Prev: Auto Fill Up: Filling
Explicit Fill Commands
Fill current paragraph (`fill-paragraph').
Set the fill column (`set-fill-column').
Fill each paragraph in the region (`fill-region').
Fill the region, considering it as one paragraph.
Center a line.
To refill a paragraph, use the command `M-q' (`fill-paragraph').
This operates on the paragraph that point is inside, or the one after
point if point is between paragraphs. Refilling works by removing all
the line-breaks, then inserting new ones where necessary.
The command `M-s' (`center-line') centers the current line within
the current fill column. With an argument, it centers several lines
individually and moves past them.
To refill many paragraphs, use `M-x fill-region', which divides the
region into paragraphs and fills each of them.
`M-q' and `fill-region' use the same criteria as `M-h' for finding
paragraph boundaries (Note: Paragraphs.). For more control, you can
use `M-x fill-region-as-paragraph', which refills everything between
point and mark. This command deletes any blank lines within the
region, so separate blocks of text end up combined into one block.
A numeric argument to `M-q' causes it to "justify" the text as well
as filling it. This means that extra spaces are inserted to make the
right margin line up exactly at the fill column. To remove the extra
spaces, use `M-q' with no argument. (Likewise for `fill-region'.)
When `adaptive-fill-mode' is non-`nil' (which is normally the case),
if you use `fill-region-as-paragraph' on an indented paragraph and you
don't have a fill prefix, it uses the indentation of the second line of
the paragraph as the fill prefix. The effect of adaptive filling is
not noticeable in Text mode, because an indented line counts as a
paragraph starter and thus each line of an indented paragraph is
considered a paragraph of its own. But you do notice the effect in
Indented Text mode and some other major modes.
The maximum line width for filling is in the variable `fill-column'.
Altering the value of `fill-column' makes it local to the current
buffer; until that time, the default value is in effect. The default is
initially 70. Note: Locals.
The easiest way to set `fill-column' is to use the command `C-x f'
(`set-fill-column'). With no argument, it sets `fill-column' to the
current horizontal position of point. With a numeric argument, it uses
that as the new fill column.
automatically generated by info2www