Charles Jamieson wrote:
> I can't get emacs to automatically place c files into fill mode. I have
> tried the following lines in .emacs:
>
> (auto-fill-mode 1)
Auto Fill is a minor mode, so its local to every buffer. But your
~/.emacs file is loaded in the *scratch* buffer.
> (auto-fill-mode t)
And, auto-fill-mode's ARG must be positive (i.e. a number) to turn it on.
> (add-hook 'C-mode-hook
> '(lambda () (turn-on-auto-fill)))
Good: Looking at its source, which is available from a hyperlink in its
doc string via `C-h f', (turn-on-auto-fill) is equivalent to
(auto-fill-mode 1).
Bad: Lisp symbols are case-sensitive. `C-h v' easily confirms that
c-mode-hook is what you want:
(add-hook 'c-mode-hook 'turn-on-auto-fill)
> (add-hook 'C-mode-hook
> '(lambda () (auto-fill-mode t))
>
> (add-hook 'C-mode-common-hook
> '(lambda () (auto-fill-mode t))
See above.