Hi Arash,

2015-09-26 16:19 GMT+02:00 Arash Esbati <esb...@gmx.de>:
> Hi all,
>
> I have a question reg. building a regexp: I have a `newfloat.el' ready
> where I have:
>
> --8<---------------cut here---------------start------------->8---
> (defvar LaTeX-newfloat-DeclareFloatingEnvironment-regex
>   `(,(concat "\\\\DeclareFloatingEnvironment"
>              "[ \t\n\r%]*"
>              "\\["
>              "[ \t\n\r%{}a-zA-Z0-9=,]*"
>              "\\]"
>              "[ \t\n\r%]*"
>              "{\\([^}]+\\)}"
>              "[ %]*{\\([^}]*\\)}")
>     (1 2) LaTeX-auto-newfloat-DeclareFloatingEnvironment)
>   "Matches the argument of `\\DeclareFloatingEnvironment' from
> `newfloat.sty'.")
> --8<---------------cut here---------------end--------------->8---
>
> The idea is to pass the type of new float-env to AUCTeX and process it,
> e.g.:
>
> --8<---------------cut here---------------start------------->8---
> \usepackage{newfloat}
>
> \DeclareFloatingEnvironment[
>   name=Code,
>   listname={List of Codes},
>   fileext=lol]{code}  %  {verbatim}
> --8<---------------cut here---------------end--------------->8---
>
> Currently, the definition above needs a mandatory `{'.  The downside is
> that if a user omits the opening brace, the regexp fails and it parses
> garbage until the next brace.

Sorry, I didn't get how the type of the environment is specified: it's
the first and only mandatory argument, isn't it?  Why one should omit
the opening brace?

Bye,
Mosè

_______________________________________________
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to