[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX] Re: reftex-label-alist not consistent
From: |
Ralf Angeli |
Subject: |
[AUCTeX] Re: reftex-label-alist not consistent |
Date: |
Sun, 13 Apr 2008 15:38:45 +0200 |
* Emilio Jesús Gallego Arias (2008-04-13) writes:
> Ralf Angeli <address@hidden> writes:
>
>> The \begin{lemma} like all the other section stuff from
>> `reftex-section-levels' and `reftex-label-alist' is only found if it is
>> followed by "[[{ \t\r\n]" (regexp-wise). I have to check if this
>> restriction can be loosened.
>
> I wonder what's the rationale behind this.
This part of the regexp is supposed to prevent stuff like \sectionxxx to
be matched if e.g. "section" is in `reftex-section-levels{-all}'.
> I changed that to be
> "[[{ \t\r\n]?" and indeed the lemmas show now correctly in the TOC.
>
> I have checked with some documents I've got here and I couldn't see any
> adverse effect, but sure we should first know the rationale behind the
> old regex before changing that.
There will likely be false positives as described above.
I've know implemented a change where environments and macros are treated
differently when the regexp is built. The check for "[[{ \t\r\n]" is
now only done for macros. Not perfect, but this should be better now.
>> The first \begin{lemma} is found and since it is treated as a section,
>> the bound for looking backwards during parsing is set to the point right
>> after it (in `reftex-parse-from-file'). Now when the label after it is
[...]
> I modified the code to set the bound to the start of the match, and then
> everything work as expected in my files, but unfortunately I don't think
> they are complex enough to say this works in every case.
I did the same thing. The change seems harmless but one never knows.
>> I'll need to check more closely how the bugs can be fixed.
>
> I hope my experiment is useful. At least I now understand what the code
> is doing thanks to your explanations.
Well, I was mostly through with implementing the changes when your
message arrived, but they gave me some confirmation with respect to what
I've done.
You can get the fixes through CVS.
> BTW, it seems we don't have a test case for reftex. I think it would be
> cool to have a pair (file.tex,file.rel) so any change to parsing can be
> tested.
(Automated) test harnesses and simular stuff are always a good idea,
especially for regression testing. But it can also be quite time
intensive creating them. This is likely the reason we don't have them
yet.
--
Ralf