auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] A question with regexps


From: Mosè Giordano
Subject: Re: [AUCTeX-devel] A question with regexps
Date: Sat, 26 Sep 2015 19:16:56 +0200

Hi Arash,

2015-09-26 16:19 GMT+02:00 Arash Esbati <address@hidden>:
> 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è



reply via email to

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