From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: Order in which hooks and defaults are applied, especially set-fill-column. Date: Wed, 03 Dec 2003 11:23:38 -0700 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3FCE2A2A.8070604@yahoo.com> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1070476516 1999 80.91.224.253 (3 Dec 2003 18:35:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 3 Dec 2003 18:35:16 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 03 19:35:13 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ARbqD-0007cY-00 for ; Wed, 03 Dec 2003 19:35:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ARchy-00042B-C3 for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Dec 2003 14:30:46 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 36 Original-NNTP-Posting-Host: 170.207.51.80 Original-X-Trace: news.uni-berlin.de 1070475818 71514608 170.207.51.80 ([82742]) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us Original-Xref: shelby.stanford.edu gnu.emacs.help:118957 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:14898 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:14898 Adam wrote: > My ~/.emacs contains the following: > > ... > ;; AucTeX > (require 'tex-site) > (add-to-list 'auto-mode-alist '("\\.tex\\'" . latex-mode)) > ;; auto-fill for certain modes > (setq-default fill-column 70) > (add-hook 'text-mode-hook 'turn-on-auto-fill) > (add-hook 'latex-mode-hook 'turn-on-auto-fill) > (add-hook 'html-mode-hook 'turn-off-auto-fill) > (add-hook 'xml-mode-hook 'turn-off-auto-fill) > (add-hook 'latex-mode-hook (lambda() (set-fill-column 100))) > ... > > > But when I open a LaTeX file, auto-fill is on and it wraps at 70. HTML > and XML files both open the way I want (with auto-fill off). Is it > possible to configure it to run the way I want -- wrapping LaTeX at 100, > not wrapping HTML and XML, and wrapping everything else at 70? I don't think the problem is that the hooks are run in the "wrong" order, but that latex-mode-hook isn't run at all -- otherwise, why would the default value of fill-column be in effect? (You could test that with `C-h v fill-column'; if it doesn't say "Local in buffer foo.latex", it was never set.) Perhaps the name of the hook is tex-mode-hook, or Tex-mode-hook, or LaTex-mode-hook. -- Kevin Rodgers