Subject: bug#5821: bug in TeX mode

From: "Dan Stratila" <[email-masked]>
Date: Fri, 2 Apr 2010 01:01:25 -0400

Hello,

The TeX mode introduces a new bug in Emacs 23.1 that was not present in
22.3. This bug is not present when using AUCTeX - I am referring to the TeX
mode that comes with Emacs.

Specifically, when I want to manually re-fill a paragraph that has an empty
comment line right before it, the first line of the paragraph is "bumped up"
into the comment line. This "breaks" the document, since of course comment
lines do not appear in the document LaTeX produces. Here is an example:

===
%
Aaa aaa bbb bbb. Aaa aaa bbb bbb. Aaa aaa bbb bbb. Aaa aaa bbb bbb. 
Aaa aaa bbb bbb. Aaa aaa bbb bbb. Aaa aaa bbb bbb. 
===

Placing the cursor on a sentence and then manually re-filling triggers the
bug. It seems to be introduced by a change on line 1052 (of the new
list/textmodes/tex-mode.el). The new line says:

===
  (setq paragraph-separate
	(concat "[\f]\\|[ \t]*\\($\\|"
		"\\\\[][]\\|"
===

The old line (which had a different number) used to say

===
  (setq paragraph-separate
	(concat "[\f%]\\|[ \t]*\\($\\|"
		"\\\\[][]\\|"
===

Reverting just this line to the old one fixes the problem.

Thanks,
Dan