Next: , Previous: Wrapping words automatically, Up: Common requests

5.16 How do I turn on auto-fill-mode by default?

To turn on auto-fill-mode just once for one buffer, use M-x auto-fill-mode.

To turn it on for every buffer in a certain mode, you must use the hook for that mode. For example, to turn on auto-fill mode for all text buffers, including the following in your .emacs file:

     (add-hook 'text-mode-hook 'turn-on-auto-fill)

If you want auto-fill mode on in all major modes, do this:

     (setq-default auto-fill-function 'do-auto-fill)