From: Michael Orlitzky <michael@orlitzky.com>
To: 38152@debbugs.gnu.org
Subject: bug#38152: tex-mode: paragraph separator groups text and comments
Date: Sat, 9 Nov 2019 09:29:12 -0500 [thread overview]
Message-ID: <1c676915-8d09-34d4-36e6-ef29cb6ef8b5@orlitzky.com> (raw)
When using M-q (fill-paragraph) in latex-mode from tex-mode.el, emacs
will incorrectly wrap text into a comment block that precedes it. This
is fairly annoying, because it can silently "delete" a huge chunk of
your document, and leave you standing in front of a class wondering
where your theorem went.
This was partially addressed in bug 5821,
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=5821
but only for comments that start at the beginning of a line. A minimal
reproducer follows, and the indentation is significant:
\begin{document}
% This is a comment.
This line won't wrap into it.
% This is also a comment.
But this line will wrap into it.
\end{document}
This is the same problem that a stack overflow user reported,
https://tex.stackexchange.com/questions/131774
and is perhaps also related to bug 23249,
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23249
which is about marking paragraphs adjacent to comments.
I don't claim that it's the correct fix for the issue, but the following
patch helps the small test case above, and at least confirms that the
paragraph separator has something to do with it:
--- a/tex-mode.el 2019-01-07 09:26:07.000000000 -0500
+++ b/tex-mode.el 2019-11-09 08:42:56.649424361 -0500
@@ -1155,7 +1155,7 @@
"\\>\\|\\\\[a-z]*" (regexp-opt '("space" "skip" "page") t)
"\\>\\)"))
(setq paragraph-separate
- (concat "[\f%]\\|[ \t]*\\($\\|"
+ (concat "\\([ \t]*%\\)\\|[\f]\\|[ \t]*\\($\\|"
"\\\\[][]\\|"
next reply other threads:[~2019-11-09 14:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-09 14:29 Michael Orlitzky [this message]
2019-11-16 7:16 ` bug#38152: tex-mode: paragraph separator groups text and comments Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1c676915-8d09-34d4-36e6-ef29cb6ef8b5@orlitzky.com \
--to=michael@orlitzky.com \
--cc=38152@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.