auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] bm.el and siunitx.el


From: Tassilo Horn
Subject: Re: [AUCTeX-devel] bm.el and siunitx.el
Date: Fri, 09 Nov 2012 16:18:07 +0100
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux)

"address@hidden" <address@hidden> 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




reply via email to

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