all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Bingham, Jay" <Jay.Bingham@hp.com>
Subject: RE: How to use set-fill-column as a hook?
Date: Wed, 11 Dec 2002 08:52:59 -0600	[thread overview]
Message-ID: <72A87F7160C0994D8C5A36E2FDC227F502473F9E@txnexc01.americas.cpqcorp.net> (raw)

In my .emacs I have:
(setq-default fill-column 75)
followed by:
(add-hook 'text-mode-hook 'turn-on-auto-fill)

When I evaluated
(add-hook 'latex-mode-hook (lambda () (setq fill-column 100)))
in the scratch buffer then created a temporary buffer and switched to
latex mode I had no problems the fill column was set to 100.
You may be right about latex mode running text mode hooks.  If that is
the case then I would recommend setting the default fill-column to the
value you want for text-mode and adding hooks for the modes that you
want to have a different value.

Good luck
-_
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: Wednesday, December 11, 2002 6:43 AM
To: help-gnu-emacs@gnu.org
Subject: RE: How to use set-fill-column as a hook?

On Tuesday 10 December 2002 15:42, Bingham, Jay wrote:

> 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.

I've tried it but I also have 
(add-hook 'text-mode-hook 'turn-on-auto-fill)
in ~/.emacs, and the value of fill-column inherited from text-mode is 
overriding the value I'm trying to set for latex-mode. (I think that 
latex-mode is running its own hooks _then_ the text-mode hooks.) I'd
really 
like to set them differently.

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

             reply	other threads:[~2002-12-11 14:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-11 14:52 Bingham, Jay [this message]
     [not found] <mailman.117.1039618386.19936.help-gnu-emacs@gnu.org>
2002-12-11 19:05 ` How to use set-fill-column as a hook? Adam
     [not found] <mailman.89.1039534939.19936.help-gnu-emacs@gnu.org>
2002-12-11 12:43 ` Adam
  -- strict thread matches above, loose matches on Subject: below --
2002-12-10 15:42 Bingham, Jay
2002-12-10 14:57 Adam
2002-12-10 14:59 ` David Kastrup
2002-12-10 15:27   ` Adam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=72A87F7160C0994D8C5A36E2FDC227F502473F9E@txnexc01.americas.cpqcorp.net \
    --to=jay.bingham@hp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.