bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tex-terminate-paragraph ignores paragraph-start and paragraph-separate


From: Joe Wells
Subject: tex-terminate-paragraph ignores paragraph-start and paragraph-separate
Date: Sun, 09 Sep 2007 07:35:54 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

The tex-terminate-paragraph command has "\n\n" hard-coded into it as
the paragraph divider and ignores paragraph-start and
paragraph-separate.  As a result, it reports false errors.

To reproduce the reporting of false errors by tex-terminate-paragraph,
first create a .tex file containing this text:

---------------------------
\documentclass{article}
\begin{document}

This is the main paragraph.

\begin{quote}
This is the first paragraph of a multi-paragraph quote.
\end{quote}

\end{document}
---------------------------

Then, move point to the end of the line that says “This is the first
paragraph of a multi-paragraph quote.”.  Then, type C-j to invoke
tex-terminate-paragraph.

The correct behavior would be to silently insert two newline
characters.  The actually buggy behavior is that
tex-terminate-paragraph also emits the false message that “Paragraph
being closed appears to contain a mismatch”.

The cause of the problem is that tex-terminate-paragraph is including
the “\begin{quote}” in the text it checks for validity but not the
corresponding “\end{quote}”, causing an error when it uses
forward-sexp to check for balance.  It is an error to include the
“\begin{quote}” because it is not part of the current paragraph.  It
makes a mistake about what is in the paragraph because it uses the
hard-coded "\n\n" as the paragraph divider.

The fix is to make tex-terminate-paragraph use a better approach to
finding the start of the current paragraph.  At the very least, it
should honor paragraph-start and paragraph-separate.

I hope this bug report is helpful.

Joe

======================================================================
In GNU Emacs 22.1.1 (i686-pc-linux-gnu, GTK+ Version 2.8.20)
 of 2007-06-27 on artemis
Windowing system distributor `The X.Org Foundation', version 11.0.70000000
configured using `configure  '--prefix=/home/jbw/local2' '--enable-debug' 
'--disable-nls' '--with-x-toolkit=gtk' 'CFLAGS=-O0 -g3 -ggdb''




reply via email to

[Prev in Thread] Current Thread [Next in Thread]