[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Order in which hooks and defaults are applied, especially set-fill-c
Re: Order in which hooks and defaults are applied, especially set-fill-column.
Wed, 03 Dec 2003 11:23:38 -0700
Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2
My ~/.emacs contains the following:
(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