[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX-devel] Management of package options [Was: Re: Add `unit' ty
From: |
Mosè Giordano |
Subject: |
Re: [AUCTeX-devel] Management of package options [Was: Re: Add `unit' type for the parser in siunitx.el] |
Date: |
Thu, 4 Apr 2013 17:49:30 +0200 |
Hi Tassilo,
2013/4/4 Tassilo Horn <address@hidden>:
> Mosè Giordano <address@hidden> writes:
>> I've used `TeX-match-buffer' to remove text properties. At the end of
>> `LaTeX-arg-usepackage' I run style hooks for every active babel
>> language. A more general solution, applicable to packages other than
>> babel, could be to reload inserted package if there are options. This
>> can be done using `TeX-unload-style', removing style from
>> `TeX-active-styles' and running `TeX-run-style-hooks'. But I believe
>> that removing style from `TeX-active-styles' should be moved inside
>> `TeX-unload-style', is it correct? Is this solution acceptable?
>
> Uh, sorry, I don't get you completely. What I understand is that when
> inserting
>
> \usepackage[german]{babel}
>
> the change to `LaTeX-arg-usepackage' will also load german. Why is that
> needed? AFAICS, loading babel will trigger loading of its active
> languages, too.
You're right, but in `LaTeX-arg-usepackage' style file is loaded by
`TeX-arg-input-file', so before you insert options. At that point for
`babel' there are no active languages, except if you set languages as
global options. That's why I've suggested to reload style file for
any package if there are options.
I'm sending a git patch with your suggestions. Thank you!
Bye,
Mosè Giordano
0001-latex.el-LaTeX-provided-class-options-New-buffer-loc.patch
Description: Binary data