# $fill-mode(5)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

$fill-mode - Global paragraph mode; justification method $buffer-fill-mode - Buffer paragraph mode; justification method

## SYNOPSIS

$fill-mode justification
$buffer-fill-mode justification

justification `b` | `c` | `l` | `n` | `o` | `r` | `B` | `C` | `L` | `N` | `R` the default is `N`

## DESCRIPTION

The fill-col variables specify the text justification modes for text filling of fill-paragraph(2).

$fill-mode defines the global default justification mode i.e. left/right/both/... The default value is none automatic (N). The modes available are:-

b Both

Enables left and right margin justification.

c Center

Enables center justification.

l Left

Enables left justification.

n None

No filling is performed, adjacent lines are not merged into a single line. This subtly different from left justification which fills lines to the $fill-col(5).

o One Line

Enables the filling of the paragraph to a single line. Typically used to prepare a file for transfer to a word processing package.

r Right

Enables right justification.

B Both (automatic)

Automatically determines the mode, defaulting to left and right (both) justification.

C Center (automatic)

Automatically determines the mode, defaulting to center justification.

L Left (automatic)

Automatically determines the mode, defaulting to left justification.

N None (automatic)

Automatically determines the mode, defaults to both and not none.

R Right (automatic)

Automatically determines the mode, defaulting to right justification.

$buffer-fill-mode specifies the fill mode value to use in a buffer, a value of $fill-mode is used as a default when the buffer is created. Modification of the $buffer-fill-mode causes the buffer fill mode to be modified, this does not affect any other buffer. The value is set by the fhook-xxx macro when initializing a buffer using the Language Templates. $buffer-fill-mode may also be modified from buffer-setup(3).

The buffer lines are automatically justified only when the justification mode justify(2m) is enabled. Justification is performed between the left and right margins, defined as 0 and $buffer-fill-col(5) respectively.

## Automatic Filling

Automatic filling is performed when the mode $buffer-fill-mode is specified in upper case. The format of the line (and adjacent lines) is interrogated and an informed guess is made as to the expected formating which is then adopted. The criteria for automatic formatting is defined as follows:-

center

If the left and right margins contain the same amount of white space +/-1 character then the paragraph is centered.

right

If the text commences past half of the $buffer-fill-col(5) (i.e. first half of the line comprises white space) AND the line extends to, or past, the `$buffer-fill-col` then the paragraph is assumed to be right justified.

none

If the text commences in column 0 and occupies less than half of the line then the paragraph is assumed to be not justified. (i.e. left justified, but consecutive lines of the paragraph are not filled)

default

If none of the above criteria are met then the default mode is adopted, as determined by the lower-case value of the $buffer-fill-mode value.

## SEE ALSO

$buffer-fill-col(5), $fill-col(5), buffer-mode(2), buffer-setup(3), fill-paragraph(2), justify(2m).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>