GNU bug report logs - #65648
13.2; indentation of nested environments

Previous Next

Package: auctex;

Reported by: Paul Nelson <ultrono <at> gmail.com>

Date: Thu, 31 Aug 2023 04:57:01 UTC

Severity: normal

Found in version 13.2

Done: Ikumi Keita <ikumi <at> ikumi.que.jp>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 65648 <at> debbugs.gnu.org (full text, mbox):

From: Uwe Brauer <oub <at> mat.ucm.es>
To: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: 65648 <at> debbugs.gnu.org, Uwe Brauer <oub <at> mat.ucm.es>,
 Paul Nelson <ultrono <at> gmail.com>
Subject: Re: bug#65648: 13.2; indentation of nested environments
Date: Sun, 03 Sep 2023 10:44:54 +0200
[Message part 1 (text/plain, inline)]
>>> "IK" == Ikumi Keita <ikumi <at> ikumi.que.jp> writes:

> Hi Paul,
>>>>>> Paul Nelson <ultrono <at> gmail.com> 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?

Frankly, rather not. Here is why.
The proposed change would lead to 


\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}



The first to begin, end on the same column, which is how it should be.

However the last one, starting with \begin{array}
*does not* end on the same column.

So I personally find this proposed behavior inferior. It makes it more
difficult to spot errors.



> [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

-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the NATO membership of the Ukraine.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/
[smime.p7s (application/pkcs7-signature, attachment)]

This bug report was last modified 1 year and 254 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.