[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with fill mode

From: Kevin Rodgers
Subject: Re: problem with fill mode
Date: Tue, 18 May 2004 16:58:16 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv: Gecko/20020406 Netscape6/6.2.2

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.

Kevin Rodgers

reply via email to

[Prev in Thread] Current Thread [Next in Thread]