>>>>> Ikumi Keita <ik...@ikumi.que.jp> writes: > How about the attached patch? It introduces a new entry :classopt in > style hook dialect and assigns all hooks associated with class option > into that new dialect. It let-binds `TeX-style-hook-dialect' to > :classopt when it runs these hooks, so the package style hooks aren't > touched.
It isn't a good idea to adhere to `TeX-run-style-hooks' after all because it taints `TeX-active-styles'. I abandoned it and took another straightforward approach in the attached patch #1, which is for the current git master. In addition, I noticed that the original idea of automatically set `TeX-PDF-from-DVI' does not work when the user types C-c C-m to input new "\usepackage" and supply "dvipdfmx" option to "geometry" or "graphicx" package. It is not limited to these cases that package options are ignored by AUCTeX when the user inputs new "\usepackage" with C-c C-m. The reason is: There are many style files which behaves suitably acoording to the package options via `LaTeX-provided-package-options-member'. They do so in the style hooks added by `TeX-add-style-hook', where `TeX-update-style' eventually runs those hooks if `TeX-auto-parse' is enabled in general. However, when "\usepackage" is entered with C-c C-m, AUCTeX runs the style hooks _before_ it asks package options to the user, so the hooks cannot know at that time the actual options entered later by the user. Thus I propose another patch #2 to defer running style hooks until the package options are actually given. How do you think about these ideas? Best, Ikumi Keita
0001-Fix-not-to-run-wrong-style-hooks.patch.gz
Description: patch#1
0002-Defer-running-style-hook-until-options-are-given-act.patch.gz
Description: patch#2
_______________________________________________ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex