[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX] Listing and not listing regions inverted if `\begin{lstlist
From: |
Denis Bitouzé |
Subject: |
Re: [AUCTeX] Listing and not listing regions inverted if `\begin{lstlisting}' not followed by what is expected |
Date: |
Mon, 23 Mar 2015 10:19:41 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
Hi Tassilo,
Le 23/03/15 à 09h12, Tassilo Horn <address@hidden> a écrit :
> Yes, nested verbatim environments is certainly not the scenario working
> best. Basically, any \begin{X} where X is some verbatim environment
> will enable verbatim fontification, and the next \end{Y} will disable it
> again. But X and Y don't need to be the same, like in
>
> \begin{latexcode} % enables verbativ fontification
> \begin{lstlisting}
> \end{lstlisting} % disables it again
> \end{javacode}
>
> AUCTeX font-latex uses syntactic fontification for verbatim blocks.
> That kind of font-lock is usually used for comments or strings, i.e.,
> all those things that usually don't nest.
OK but, if `latexcode' is not declared as a verbatim environment, only
`lstlisting' is considered as such in:
┌────
│ \begin{latexcode}
│ \begin{lstlisting}+\only<2->{+[+\emph{options}+]+}+
│ +\emph{listing}+
│ \end{lstlisting}
│ \end{latexcode}
└────
and what is strange is that, because of the non expected `+' in:
┌────
│ \begin{lstlisting}+\only<2->{+[+\emph{options}+]+}+
└────
the beginning of this environment is missed (okay) /but/ that's the
following `\end{lstlisting}' which is considered as the /beginning/ of
this environment.
Wouldn't it be possible for `\end{...}' to never be considered as the
/beginning/ of `...' environment?
Meanwhile, is it possible to stop a listing region highlight with some
(magic) comments?
Thanks!
--
Denis