Motivation: Using the defaults, Auto Fill mode seems not as useful as I might have hoped: If I insert a sentence in the middle of a paragraph, only the current line is re-filled. When I insert a sentence, I want the entire paragraph to be re-filled.
Question: How can I set auto-fill-function
(or perhaps
normal-auto-fill-function
) in my .emacs
file so that the paragraph is re-filled whenever a single line overflows?
I tried setting it to fill-paragraph
, but then I cannot insert any spaces at the end of a paragraph (e.g., to add another word).
More details: I primarily use Auto Fill mode in the AUCTeX major mode for LaTeX.
The built-in Emacs documentation for auto-fill-mode
states:
When
auto-fill-mode
is on, theauto-fill-function
variable is non-nil
.The value of
normal-auto-fill-function
specifies the function to use forauto-fill-function
when turning Auto Fill mode on.
The documentation for the normal-auto-fill-function
variable
says that it is the function to use for auto-fill-function
if Auto Fill mode is
turned on, and that the initial value is do-auto-fill
.