[Top][All Lists]

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

Re: [AUCTeX] Set automatically TeX-PDF-from-DVI variable if documentclas

From: Ikumi Keita
Subject: Re: [AUCTeX] Set automatically TeX-PDF-from-DVI variable if documentclass receives option dvipdfmx or dvipdfm
Date: Thu, 15 Nov 2018 21:38:55 +0900

>>>>> Ikumi Keita <address@hidden> 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
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?

Ikumi Keita

Attachment: 0001-Fix-not-to-run-wrong-style-hooks.patch.gz
Description: patch#1

Attachment: 0002-Defer-running-style-hook-until-options-are-given-act.patch.gz
Description: patch#2

reply via email to

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