Subject: Re: bug#36358: Indentation of not matched braces in latex-mode

From: Stefan Monnier <[email-masked]>
Date: Wed, 26 Jun 2019 09:49:53 -0400

> I may be wrong but do we need to include environments?

I don't understand the question.  AFAIK this discussion and the patch
I installed is independent from what happens to environments.

> Idea: Maybe if its at the beginning of the line and there is no text
> after '}' - indent? And if it has text after OR before OR is
> surrounded by it - noindet.  This would fit for things like 'section',
> 'emph' would be indented as well but it would not be inside paragraph
> but as a separate being, so it can be indented.  I didn't check other
> commands/env so there could be exceptions...

Hmm... I can try something like that.  Making indentation depend on text
after the } is a bit unorthodox (we generally refrain from making
indentation depend on text that comes later), but it might be
worthwhile here.

>> It seems to indent by 2 regardless of the command, just like what
>> you don't want.
> Because this is the default value, and with setq we can change it to 0.

Yes, of course, but I meant that it also does it for all commands.

> Also when I byte compiled tex-mode.el with your changes, there was a
> warning about unused 'x' or something like that - could it be one of
> 'lambda (x)' in 'defcustom latex-noindent-environments'?

I believe this was fixed a few hours later by Basil.
Do you still see it with the current code?

> Also I think declarations doesn't work(1) or are mixed(2):
> {\small Quisque ullamcorper placerat ipsum.  Cras nibh.  Morbi
>   vel justo vitae lacus tincidunt ultrices.  Lorem ipsum dolor sit
>   amet, consectetuer adipiscing elit.}
>
> {\small\emph{Quisque ullamcorper placerat ipsum.  Cras nibh.  Morbi
> vel justo vitae lacus tincidunt ultrices.}  Lorem ipsum dolor sit
>   amet, consectetuer adipiscing elit.}

Hmm... that looks wrong indeed: will have to investigate, thanks.

        Stefan