auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] Add `unit' type for the parser in siunitx.el


From: Tassilo Horn
Subject: Re: [AUCTeX-devel] Add `unit' type for the parser in siunitx.el
Date: Tue, 12 Feb 2013 09:25:50 +0100
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux)

Mosè Giordano <address@hidden> 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




reply via email to

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