Mosè Giordano <[email protected]> writes:

> 3) For some reason, you decide you don't need `siunitx' package
> anymore in your source and you remove it.  Then you save the buffer.
> AUCTeX re-parses the buffer and writes the parsed file, but with
> `(LaTeX-add-siunitx-units <new units>)' and without `siunitx' hook.
> 4) You close Emacs.
> 5) You reopen the LaTeX source.  AUCTeX finds the the parsed file and
> evaluate it, when it finds `LaTeX-add-siunitx-units' function it don't
> know what it is (`siunitx' hook has not been run) and returns error
>     Symbol's function definition is void: LaTeX-add-siunitx-units
>
> I suggest the following solution: create a variable containing strings
> of code to be written at the beginning of parsed file.  In
> `siunitx.el' I can add the string
>     (TeX-auto-add-type "siunitx-unit" "LaTeX")
> to this variable, so at step 5 of the above situation AUCTeX won't
> complain about the unknown `LaTeX-add-siunitx-units' function.  When
> you save the buffer after step 5, the string
>     (TeX-auto-add-type "siunitx-unit" "LaTeX")
> and `(LaTeX-add-siunitx-units <new units>)' won't be written to parsed
> file and AUCTeX can forget forever about `siunitx-unit' type.

That doesn't sound like the right solution.  Too much fuzz for such an
uncommon use-case, IMHO.

Maybe the style hooks should be run inside a `condition-case', and in
case of an error we simply run `TeX-normal-mode'?

Bye,
Tassilo


_______________________________________________
auctex-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to