Hi Paul,

"Paul D. Nelson" <[email protected]> writes:

> To reproduce, put this in a LaTeX-mode buffer:
>
> % \begin{split}
> %   a &= b.
> % \end{split}
>
> Make sure LaTeX-syntactic-comments is set to t (the default).
>
> There are two related issues:
>
> 1. Run indent-region on the second line.  This inserts two spaces before
> "%", when it shouldn't.
>
> 2. Then, run indent-region on the third line.  This gives the error:
>
> "Can’t locate beginning of current environment"
>
> The issue is that LaTeX-indent-calculate uses the indent logic for
> special environments even when computing the outer indentation for
> comments (i.e., what comes before the "%"), where it shouldn't apply.
>
> With the attached patch, it skips that logic in such cases.

Thanks for the report, I can confirm the above.  I didn't install your
patch, but did you try it also in `docTeX-mode'?  The current code work
in a .dtx file as expected with the example above.

Best, Arash



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

Reply via email to