auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX] Setting file-local list variables


From: Ralf Angeli
Subject: Re: [AUCTeX] Setting file-local list variables
Date: Wed, 21 May 2008 22:58:51 +0200

* Mark Elston (2008-05-20) writes:

> However, when I put the following in my .tex file:
>
> %%% Local Variables:
> %%% mode: latex
> %%% TeX-master: t
> %%% LaTeX-verbatim-environments: ("verbatim" "verbatim*" "CodeListing" 
> "OldCodeListing" "NewCodeListing")
> %%% End:
>
> I get a warning when loading the file that setting the variable may
> not be safe.  I hit 'y' to apply the local variables list and the file
> is loaded.  However, even though I can look at the variable and see that
> it is set appropriately, AucTeX doesn't handle these environments as
> verbatim environments.
>
> If I customize the variable then it works fine.
>
> How do I set this variable so that it applies to the file?

Unfortunately the font locking variables are being set up by font-latex
after `kill-all-local-variables' was run during the mode initialization
and before the local variables stanza is being evaluated again.  You
could force font locking setup to be re-run when the local variables are
set up by adding
%%% eval: (funcall 'font-latex-setup)
to your file, but this is really a brute force method which makes
assumptions about AUCTeX's font locking internals and which might not be
free of side effects.

I'd rather put the environments permanently into
`LaTeX-verbatim-environments'.  It likely won't happen too often that
you encounter environments with these names in other files.

-- 
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]