|
From: | Mosè Giordano |
Subject: | Re: [AUCTeX-devel] Management of package options [Was: Re: Add `unit' type for the parser in siunitx.el] |
Date: | Wed, 3 Apr 2013 23:07:27 +0200 |
Hi Tassilo, I'm sending the whole patch set. It's a bit different from my previous patches, because after some testing I've noticed they didn't work well if one use `TeX-auto-generate-global' (many major GNU/Linux distros run it after installing AUCTeX package). Now in `TeX-auto-store' I add elements to `LaTeX-provided-{class,package}-options' instead of setq'ing these variables, because in that case loading styles of included files would make a mess with the value of those variables. I've defined a new function to add an alist to another. 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? Here is the ChangeLog entry: 2013-04-03 Mosè Giordano <address@hidden> * latex.el (LaTeX-provided-class-options): New buffer-local variable. (LaTeX-provided-class-options-member): New function. (LaTeX-provided-package-options): New buffer-local variable. (LaTeX-provided-package-options-member): New function (LaTeX-auto-cleanup): Rewrite to support `LaTeX-provided-{class,package}-options' variables. (LaTeX-arg-usepackage): Ditto. * tex.el (TeX-auto-store): Write to parsed file values of `LaTeX-provided-{class,package}-options' variables. (TeX-auto-insert): Fix indentation of inserted lines. (TeX-search-files-by-type): Fix typo in doc-string. (TeX-add-to-alist): New function. (TeX-quote-language-alist): Fix typo in doc-string. * style/babel.el (LaTeX-babel-package-options): Add missing languages. (LaTeX-babel-package-options): Add options other than languages. (LaTeX-babel-active-languages): Use `LaTeX-provided-{class,package}-options'. Loop over actually used options instead of all babel languages. ("babel"): Run styles of active languages. * style/biblatex.el ("biblatex"): Use `LaTeX-provided-package-options-member'. (LaTeX-biblatex-package-options): Consider the `ask' value for 'TeX-arg-input-file-search'. * style/kpfonts.el ("kpfonts"): Use `LaTeX-provided-package-options-member'. * style/siunitx.el: Rename `TeX-siunitx-*' functions to `LaTeX-siunitx-*' for consistency. ("siunitx"): Use `LaTeX-provided-package-options-member'. Bye, Mosè Giordano
tex.el.patch
Description: Binary data
babel.el.patch
Description: Binary data
biblatex.el.patch
Description: Binary data
kpfonts.el.patch
Description: Binary data
siunitx.el.patch
Description: Binary data
latex.el.patch
Description: Binary data
[Prev in Thread] | Current Thread | [Next in Thread] |