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.

I played around and tried to limit it with `$' or `{?' etc., but could
not come up with something sensible.  Has anybody an idea how solve
this?

I'm attaching the style in case somebody wants to have a look.

TIA.  Best, Arash

Attachment: newfloat.el
Description: application/emacs-lisp

_______________________________________________
auctex-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to