Subject: bug#74009: 14.0.6.2024-10-22_10:04:26; LaTeX-fill-environment does strange things when % is present

From: Arash Esbati <[email-masked]>
Date: Tue, 29 Oct 2024 21:35:24 +0100

Uwe Brauer <[email-masked]> writes:

>     2. I receive lately a lot of latex files, with very very long lines
>        (it seems that a lot of latex editor now support soft line
>        wrapping), emacs still struggles I use virtual-auto-fill-mode
>        from time to time but it is inferior than running auctex latex
>        fill commands. So mostly I run LaTeX-fill-section on those files,
>        and as this example indicates this can result in a sort of
>        catastrophe since emacs becomes idle but is then silently filling
>        the buffer with these
>        %
>        %
>        lines.

AUCTeX shouldn't behave like this, so we should investigate why this
happens, but OTOH, AUCTeX isn't a text formatter for all sort of strange
code.  Maybe you want to give latexindent[1] a try and see, if it does a
better job in your case.

Best, Arash

Footnotes:
[1]  https://ctan.org/pkg/latexindent