* problem with fill mode
@ 2004-05-18 21:02 Charles Jamieson
2004-05-18 22:58 ` Kevin Rodgers
0 siblings, 1 reply; 3+ messages in thread
From: Charles Jamieson @ 2004-05-18 21:02 UTC (permalink / raw)
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-mode t)
(add-hook 'C-mode-hook
'(lambda () (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))
Here is a copy of my entire message buffer, in case anyone thinks
another startup file is interfering with my .emacs file.
Loading disp-table...done
Loading tool-bar...done
Loading image...done
Loading tooltip...done
Loading /usr/share/emacs/site-lisp/site-start.d/aspell-init.el
(source)...done
Loading
/usr/share/emacs/site-lisp/site-start.d/lang-coding-systems-init.el
(source)...
Loading encoded-kb...done
Loading
/usr/share/emacs/site-lisp/site-start.d/lang-coding-systems-init.el
(source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/php-mode-init.el
(source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/po-mode-init.el
(source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/psgml-init.el
(source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/python-mode-init.el
(source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/rpm-spec-mode-init.el
(source)...done
Loading font-lock...
Loading regexp-opt...done
Loading font-lock...done
Loading mwheel...done
Loading delsel...done
Loading cc-styles...done
For information about the GNU Project and its goals, type C-h C-p.
Loading cc-mode...done
Loading lazy-lock...done
Fontifying main.cpp... (regexps...................)
Loading lazy-lock...done
Loading view...done
Mark set [4 times]
-charles
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: problem with fill mode
2004-05-18 21:02 problem with fill mode Charles Jamieson
@ 2004-05-18 22:58 ` Kevin Rodgers
2004-05-18 23:49 ` Charles Jamieson
0 siblings, 1 reply; 3+ messages in thread
From: Kevin Rodgers @ 2004-05-18 22:58 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: problem with fill mode
2004-05-18 22:58 ` Kevin Rodgers
@ 2004-05-18 23:49 ` Charles Jamieson
0 siblings, 0 replies; 3+ messages in thread
From: Charles Jamieson @ 2004-05-18 23:49 UTC (permalink / raw)
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.
Thanks,
-charles
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-05-18 23:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-18 21:02 problem with fill mode Charles Jamieson
2004-05-18 22:58 ` Kevin Rodgers
2004-05-18 23:49 ` Charles Jamieson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).