all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* tex-terminate-paragraph ignores paragraph-start and paragraph-separate
@ 2007-09-09  6:35 Joe Wells
  2007-09-09  8:47 ` martin rudalics
  0 siblings, 1 reply; 6+ messages in thread
From: Joe Wells @ 2007-09-09  6:35 UTC (permalink / raw)
  To: bug-gnu-emacs

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''

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-09-20  3:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-09  6:35 tex-terminate-paragraph ignores paragraph-start and paragraph-separate Joe Wells
2007-09-09  8:47 ` martin rudalics
2007-09-09 10:28   ` Joe Wells
2007-09-19  7:30     ` Glenn Morris
2007-09-19  8:28       ` Joe Wells
2007-09-20  3:13         ` Glenn Morris

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.