"[email protected]" <[email protected]> writes:
Hi Mosè, > I wrote AUCTeX style files for `bm' and `siunitx' packages, you can find them > here: > https://raw.github.com/giordano/auctex-styles/master/bm.el > https://raw.github.com/giordano/auctex-styles/master/siunitx.el Looks good. > `TeX-auto-generate' function is able to parse `bm.sty' but the > resulting file doesn't provide fontification, instead `siunitx.sty' > can't be parsed correctly by `TeX-auto-generate' since it uses > `\NewDocumentCommand' provided by `xparse. sty'. It would be great > to have `\*DocumentCommand' macros by `xparse' package correctly > parsed, like `\newcommand', `\providecommand', etc. I've just looked at it, but it's not so simple. For example, that's such a def: \NewDocumentCommand \SIlist { o > { \SplitList { ; } } m m } { \leavevmode \group_begin: \IfNoValueTF {#1} { \siunitx_list_units:nnn {#2} {#3} { } } { \keys_set:nn { siunitx } {#1} \siunitx_list_units:nnn {#2} {#3} {#1} } \group_end: } The "{ o > { \SplitList { ; } } m m }" means first some optional arg (separated with ;?), then 2 mandatory args. Well, of course, just making the parsing stuff rip out the names is easy. An entry like ("\\\\\\(Declare\\|New\\|Provide\\|Renew\\)DocumentCommand\\*?[{ ]?\\\\\\([A-Z_a-z]+\\)}?" 1 TeX-auto-symbol) in `LaTeX-auto-class-regexp-list' should make that work. But I have no clue about these argument specs. IMO, your hand-written siunitx.el approach is better, since it given meaning to the arguments which cannot be done automatically. > I'm willing to license these files under GPL and assign my copyright > to FSF, by I haven't already signed copyright papers. I've sent you the assignment request form. Bye, Tassilo _______________________________________________ auctex-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/auctex-devel
