help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: How to use set-fill-column as a hook?


From: Bingham, Jay
Subject: RE: How to use set-fill-column as a hook?
Date: Tue, 10 Dec 2002 09:42:08 -0600

Try this, it worked for me.

(add-hook 'latex-mode-hook (lambda () (setq fill-column 100)))

Any mode that has a mode hook, all that I have seen do, can be set in a
similar manner.  Just specify the appropriate mode hook and the value
that you want the fill-column to be for the mode.
Individual mode customizations have to be done with a mode hook because
the variable fill-column becomes buffer local when it is set in any
manner.  Since the since the mode hooks get executed each time the mode
in invoked, i.e. each time a buffer is created in that mode or you
change a buffer to that mode.

-_
J_)
C_)ingham
.    HP - NonStop Austin Software & Services - Software Quality
Assurance
.    Austin, TX
. "Language is the apparel in which your thoughts parade in public.
.  Never clothe them in vulgar and shoddy attire."     -Dr. George W.
Crane-

-----Original Message-----
From: Adam [mailto:a24061@void.yahoo.void.com] 
Sent: Tuesday, December 10, 2002 8:57 AM
To: help-gnu-emacs@gnu.org
Subject: How to use set-fill-column as a hook?

I have the following in ~/.emacs:

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

I now want to set the fill-column differently for LaTeX files.

This doesn't do anything (I verified with C-h v that the value of 
fill-column is 70, the default):
(add-hook 'latex-mode-hook '('set-fill-column 100))

This gives an error when starting emacs:
(add-hook 'latex-mode-hook ('set-fill-column 100))

What's the correct syntax?


Also, once I've done that, can I set it differently for mail-mode and 
text-mode?

Thanks,
Adam

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnu-emacs



reply via email to

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