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: Arash Esbati
Subject: Re: [AUCTeX-devel] A question with regexps
Date: Sat, 26 Sep 2015 23:37:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5

Hi Mosè,

Mosè Giordano <address@hidden> writes:

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

Thanks for your response and sorry for being unclear.  Let me rephrase
that: The idea is to pass the type of a new float-env to AUCTeX as a
TeX-comment enclosed in braces, e.g.

--8<---------------cut here---------------start------------->8---
\usepackage{newfloat}

\DeclareFloatingEnvironment[
  name=Code,
  listname={List of Codes},
  fileext=lol]{code}  %  {verbatim}
%                     ^^^^^^^^^^^^^ {verbatim|figure|table}
--8<---------------cut here---------------end--------------->8---

I am looking at everything following the `{code}'.  My current
definition fails if a user does something like:

--8<---------------cut here---------------start------------->8---
\usepackage{newfloat}

\DeclareFloatingEnvironment[
  name=Code,
  listname={List of Codes},
  fileext=lol]{code}
%                   ^ no `{' after this point
--8<---------------cut here---------------end--------------->8---

I hope it is more clear now.

Best, Arash




reply via email to

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