Subject: Re: bug#65648: 13.2; indentation of nested environments

From: Ikumi Keita <[email-masked]>
Date: Sun, 03 Sep 2023 17:24:39 +0900

Hi Paul,

>>>>> Paul Nelson <[email-masked]> writes:
> A practical workaround for the user is to make sure that \begin{} is
> always the first non-whitespace on its line (and to enforce that
> requirement on coauthors via ~(defun fix-tex-buffer ...)~), but that
> seems suboptimal.

> The following seems to resolve the issue:

Thanks for your proposal. I think it can be a practical solution for
bug#54949[1] as well.

The proposal gives one failure for regression test, namely the case Uwe
Brauer raised last year[2]. Current AUCTeX indents
----------------------------------------------------------------------
\begin{equation}
  \begin{aligned}
&n u m=\left[\begin{array}{ll}
2 & 25
\end{array}\right] \\
&d e n=\left[\begin{array}{lll}
1 & 4 & 25
\end{array}\right]
\end{aligned}
\end{equation}
----------------------------------------------------------------------
into
----------------------------------------------------------------------
\begin{equation}
  \begin{aligned}
    &n u m=\left[\begin{array}{ll}
                   2 & 25
                 \end{array}\right] \\
    &d e n=\left[\begin{array}{lll}
                   1 & 4 & 25
                 \end{array}\right]
  \end{aligned}
\end{equation}
----------------------------------------------------------------------
while this proposal gives
----------------------------------------------------------------------
\begin{equation}
  \begin{aligned}
    &n u m=\left[\begin{array}{ll}
                   2 & 25
    \end{array}\right] \\
    &d e n=\left[\begin{array}{lll}
                   1 & 4 & 25
    \end{array}\right]
  \end{aligned}
\end{equation}
----------------------------------------------------------------------
, which seems me another reasonable behavior. Uwe, what do you think
about it? Is this result acceptable for you?

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54949
[2] https://lists.gnu.org/r/auctex-devel/2022-01/msg00055.html

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine