Next: , Previous: , Up: Editing Documents   [Contents][Index]


4.3 Filling

Filling is a coarse text-formatting process which attempts to make all the lines roughly the same length, but doesn’t vary the amount of space between words. Editing text may leave lines with all sorts of strange lengths; filling this text will return it to a moderately aesthetic form.

Command: Set Fill Column (bound to C-x f)

This command sets the fill column to the column that the point is currently at, or the one specified by the absolute value of prefix argument, if it is supplied. The fill column is the column past which no text is permitted to extend.

Command: Set Fill Prefix (bound to C-x .)

This command sets the fill prefix to the text from the beginning of the current line to the point. The fill-prefix is a string which filling commands leave at the beginning of every line filled. This feature is useful for filling indented text or comments.

Hemlock Variable: Fill Column (initial value 75)
Hemlock Variable: Fill Prefix (initial value nil)

These variables hold the value of the fill prefix and fill column, thus setting these variables will change the way filling is done. If Fill Prefix is nil, then there is no fill prefix.

Command: Fill Paragraph (bound to M-q)

This command fills the text in the current or next paragraph. The point is not moved.

Command: Fill Region (bound to M-g)

This command fills the text in the region. Since filling can mangle a large quantity of text, this command asks for confirmation before filling a large region (see Region Query Size.)

Command: Auto Fill Mode

This command turns on or off the Fill minor mode in the current buffer. When in Fill mode, Space, Return and Linefeed are rebound to commands that check whether the point is past the fill column and fill the current line if it is. This enables typing text without having to break the lines manually.

If a prefix argument is supplied, then instead of toggling, the sign determines whether Fill mode is turned off; a positive argument argument turns in on, and a negative one turns it off.

Command: Auto Fill Linefeed stuff (bound to Linefeed in Fill mode)
Command: Auto Fill Return stuff (bound to Return in Fill mode)

Auto Fill Linefeed fills the current line if it needs it and then goes to a new line and inserts the fill prefix. Auto Fill Return is similar, but does not insert the fill prefix on the new line.

Command: Auto Fill Space stuff (bound to Space in Fill mode)

If no prefix argument is supplied, this command inserts a space and fills the current line if it extends past the fill column. If the argument is zero, then it fills the line if needed, but does not insert a space. If the argument is positive, then that many spaces are inserted without filling.

Hemlock Variable: Auto Fill Space Indent (initial value nil)

This variable determines how lines are broken by the auto fill commands. If it is true, new lines are created using the Indent New Comment Line command, otherwise the New Line command is used. Language modes should define this variable to be true so that auto fill mode can be used on code.


Next: Scribe Mode, Previous: Paragraph Commands, Up: Editing Documents   [Contents][Index]