unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Order in which hooks and defaults are applied, especially set-fill-column.
@ 2003-12-02 15:21 Adam
  2003-12-03 18:23 ` Kevin Rodgers
  2003-12-03 20:15 ` Stefan Monnier
  0 siblings, 2 replies; 4+ messages in thread
From: Adam @ 2003-12-02 15:21 UTC (permalink / raw)


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?

Thanks,
Adam

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Order in which hooks and defaults are applied, especially set-fill-column.
  2003-12-02 15:21 Order in which hooks and defaults are applied, especially set-fill-column Adam
@ 2003-12-03 18:23 ` Kevin Rodgers
  2003-12-03 20:15 ` Stefan Monnier
  1 sibling, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2003-12-03 18:23 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Order in which hooks and defaults are applied, especially set-fill-column.
  2003-12-02 15:21 Order in which hooks and defaults are applied, especially set-fill-column Adam
  2003-12-03 18:23 ` Kevin Rodgers
@ 2003-12-03 20:15 ` Stefan Monnier
  2003-12-03 22:17   ` Adam
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2003-12-03 20:15 UTC (permalink / raw)


> ;; AucTeX

The default LaTeX editing mode in Emacs is `latex-mode' and runs
`latex-mode-hook'.  The mode offered by AUCTeX is called `LaTeX-mode'
and runs `LaTeX-mode-hook'.


        Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Order in which hooks and defaults are applied, especially set-fill-column.
  2003-12-03 20:15 ` Stefan Monnier
@ 2003-12-03 22:17   ` Adam
  0 siblings, 0 replies; 4+ messages in thread
From: Adam @ 2003-12-03 22:17 UTC (permalink / raw)


On Wednesday 03 December 2003 20:15, Stefan Monnier wrote:

>> ;; AucTeX
> 
> The default LaTeX editing mode in Emacs is `latex-mode' and runs
> `latex-mode-hook'.  The mode offered by AUCTeX is called `LaTeX-mode'
> and runs `LaTeX-mode-hook'.

My ~/.emacs now includes the stuff below and I believe everything works 
the way I want.

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

Thank you very much for your help!

-- Adam

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-12-03 22:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-02 15:21 Order in which hooks and defaults are applied, especially set-fill-column Adam
2003-12-03 18:23 ` Kevin Rodgers
2003-12-03 20:15 ` Stefan Monnier
2003-12-03 22:17   ` Adam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).