auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Empty line after an environment & bug#35284: 12.1.1; new verbatim en


From: Ikumi Keita
Subject: Re: Empty line after an environment & bug#35284: 12.1.1; new verbatim environment wrongly commented out
Date: Wed, 23 Dec 2020 21:43:33 +0900

Hi all,

I'd like to improve the behavior of `LaTeX-insert-environment' inside
other environments a bit further.

Suppose that there are following lines in a LaTeX document, where "-!-"
denotes the cursor position.

\begin{center}
  abc-!- xyz
\end{center}

Currently, Typing C-c C-e equation RET results in:

\begin{center}
  abc
  \begin{equation}
    \label{eq:1}
    -!-
  \end{equation}
xyz
\end{center}

Note that "xyz" is not indented and just at the beginning of the line. I
think this "xyz" should be indented as well. When one continues edit at
the position after "xyz", it usually ends up with typing TAB to get the
suitable indent for the line.

I expect that the attached patch does this job. It introduces a new flag
to distinguish whether there is additional text after the position where
the new environment is inserted, and does another indent if such text
exists.

I used this patch for 3 months or so and it worked as expected.

Does anyone find difficulties with this idea? E.g., should I introduce
some new user option to suppress this behavior?

Regards,
Ikumi Keita

Attachment: patch
Description: patch to do additional indent


reply via email to

[Prev in Thread] Current Thread [Next in Thread]