[Top][All Lists]

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

Re: problem with fill mode

From: Charles Jamieson
Subject: Re: problem with fill mode
Date: Tue, 18 May 2004 23:49:39 GMT
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1

Kevin Rodgers wrote:
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.

This is exactly what I needed.


reply via email to

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