On Tue, 23 Jun 2020, Mattias Engdegård wrote: > Thank you! This bug has been fixed in Emacs 27; see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38152 . Thanks for the pointer. I confirm that the patch in bug #38152 fixes the previous test case. However the following slightly different test case still has a similar problem: ---- snip ---- \documentclass{article} \begin{document} \begin{environment} Some code % a comment More code \end{environment} \end{document} ---- snip ---- If you position point at the start of the line " More code" and hit M-q, the result is \begin{environment} Some code % a comment More code \end{environment} Should this bug #42016 be reopened or should I file a new bug? -- Nate Eldredge nate@thatsmathematics.com