Next: Auto Filling, Previous: Margins, Up: Text
Adaptive Fill mode chooses a fill prefix automatically from the text in each paragraph being filled.
Adaptive Fill mode is enabled when this variable is non-
nil
. It ist
by default.
This function implements the heart of Adaptive Fill mode; it chooses a fill prefix based on the text between from and to. It does this by looking at the first two lines of the paragraph, based on the variables described below.
This variable holds a regular expression to control Adaptive Fill mode. Adaptive Fill mode matches this regular expression against the text starting after the left margin whitespace (if any) on a line; the characters it matches are that line's candidate for the fill prefix.
In a one-line paragraph, if the candidate fill prefix matches this regular expression, or if it matches
comment-start-skip
, then it is used—otherwise, spaces amounting to the same width are used instead.However, the fill prefix is never taken from a one-line paragraph if it would act as a paragraph starter on subsequent lines.
You can specify more complex ways of choosing a fill prefix automatically by setting this variable to a function. The function is called when
adaptive-fill-regexp
does not match, with point after the left margin of a line, and it should return the appropriate fill prefix based on that line. If it returnsnil
, that means it sees no fill prefix in that line.