From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Bingham, Jay" Newsgroups: gmane.emacs.help Subject: RE: How to use set-fill-column as a hook? Date: Wed, 11 Dec 2002 08:52:59 -0600 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <72A87F7160C0994D8C5A36E2FDC227F502473F9E@txnexc01.americas.cpqcorp.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1039618707 1041 80.91.224.249 (11 Dec 2002 14:58:27 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 11 Dec 2002 14:58:27 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18M8Jd-0000Gd-00 for ; Wed, 11 Dec 2002 15:58:25 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18M8Ej-0005q3-02 for gnu-help-gnu-emacs@m.gmane.org; Wed, 11 Dec 2002 09:53:21 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18M8ES-0005ot-00 for help-gnu-emacs@gnu.org; Wed, 11 Dec 2002 09:53:04 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18M8EP-0005nt-00 for help-gnu-emacs@gnu.org; Wed, 11 Dec 2002 09:53:03 -0500 Original-Received: from zcamail03.zca.compaq.com ([161.114.32.103]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18M8EP-0005nL-00 for help-gnu-emacs@gnu.org; Wed, 11 Dec 2002 09:53:01 -0500 Original-Received: from cacexg12.americas.cpqcorp.net (cacexg12.americas.cpqcorp.net [16.105.250.119]) by zcamail03.zca.compaq.com (Postfix) with ESMTP id A9C7B3302; Wed, 11 Dec 2002 06:53:00 -0800 (PST) Original-Received: from txnexc01.americas.cpqcorp.net ([16.74.7.244]) by cacexg12.americas.cpqcorp.net with Microsoft SMTPSVC(5.0.2195.2966); Wed, 11 Dec 2002 06:53:00 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: How to use set-fill-column as a hook? Thread-Index: AcKhE1jma+NrHkETS8mbqRwVVHWA8QAEC2OQ Original-To: "Adam" , X-OriginalArrivalTime: 11 Dec 2002 14:53:00.0335 (UTC) FILETIME=[FFDCCBF0:01C2A124] X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:4530 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:4530 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]=20 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. >=20 > (add-hook 'latex-mode-hook (lambda () (setq fill-column 100))) >=20 > 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=20 (add-hook 'text-mode-hook 'turn-on-auto-fill) in ~/.emacs, and the value of fill-column inherited from text-mode is=20 overriding the value I'm trying to set for latex-mode. (I think that=20 latex-mode is running its own hooks _then_ the text-mode hooks.) I'd really=20 like to set them differently. _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://mail.gnu.org/mailman/listinfo/help-gnu-emacs