Subject: bug#48075: LaTeX-fill-paragraph and Comments with Long Equations

From: Mitchell Riley <[email-masked]>
Date: Wed, 28 Apr 2021 12:33:43 +1000

Dear AUCTeX developers,

I am encountering an infinite loop when trying to fill buffers that contain
long commented out equations. The specific equation doesn't seem to matter,
for example, trying to fill a buffer with only the line
% $++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++$
or the line
% $\times \times \times \times \times \times \times \times \times \times
\times$
will cause Emacs to hang. Interrupting the filling with C-g shows that
thousands of empty comment lines are being added to the buffer. Filling
succeeds if the $s are removed, so there must be something specific to
equations going on.

I'm afraid I have no experience reading elisp code, so I don't have much
chance of figuring out the issue myself, sorry...

Mitchell