help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: indentation


From: Wayne Harris
Subject: Re: indentation
Date: Sat, 01 May 2021 10:43:41 -0300

Tassilo Horn <tsdh@gnu.org> writes:

> Wayne Harris via Users list for the GNU Emacs text editor
> <help-gnu-emacs@gnu.org> writes:
>
> Hi Wayne,
>
>> Today I was writing some TeX and the following happened.  Let me use
>> ``[]'' to represent the point.
>>
>> \noindent {\em Notation.} As we often write polynomials in
>> finite rings of characterisc 2, let's define
>> %v
>>   \[\poly(x) = ...\]
>> %e
>> in the same way that it was used in the introduction.  []%% Well...
>>
>> When I pressed RET, I got this
>>
>> \noindent {\em Notation.} As we often write polynomials in
>> finite rings of characterisc 2, let's define
>> %v
>>   \[\poly(x) = ...\]
>> %e
>>   in the same way that it was used in the introduction.
>>   []%% Well...
>
> Electric indent works well when you just let Emacs do the indentation.
> In your example, Emacs wouldn't indent the inline math (hitting TAB in
> that line makes it pop to column 0), and then the next sentence wouldn't
> be indented as well.  So basically you are fighting Emacs' LaTeX
> indentation rules, and that becomes harder when `electric-indent-mode'
> is enabled [1].  (At least with AUCTeX, `fill-paragraph' will also
> adjust the indentation.)
>
> FWIW, I'd write your example as
>
> \noindent {\em Notation.} As we often write polynomials in finite rings of
> characterisc 2, let's define
> \[
>   \poly(x) = ...
> \]
> in the same way that it was used in the introduction.
>
> which is indented according to how AUCTeX would do it or the builtin
> `latex-mode' if `latex-indent-within-escaped-parens' is t.

Thank you.  I had no idea what was going on there.  Clearly the root
cause of the problem is not understanding what is going on.  That's
life: I took a while to begin using paredit-mode precisely for not being
able to minimially live with it, but it's been really worth it to try.
(I use it constantly now.)  Maybe the same will happen with
electric-indent-mode.

Definitely consider this subthread a request for help, not a complaint.
But like the OP remarked, as these different behaviors appear after an
upgrade to a newer version, it's a bit scary to imagine we won't survive
with the new version.




reply via email to

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