From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joe Wells Newsgroups: gmane.emacs.bugs Subject: tex-terminate-paragraph ignores paragraph-start and paragraph-separate Date: Sun, 09 Sep 2007 07:35:54 +0100 Message-ID: <86r6l8s5v9.fsf@macs.hw.ac.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1189324702 1064 80.91.229.12 (9 Sep 2007 07:58:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 9 Sep 2007 07:58:22 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 09 17:58:09 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IUNt9-0006HI-F6 for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Sep 2007 16:35:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IUGOm-0006W7-L7 for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Sep 2007 02:36:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IUGOk-0006UR-PM for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2007 02:35:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IUGOj-0006SR-5S for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2007 02:35:58 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IUGOj-0006SK-3F for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2007 02:35:57 -0400 Original-Received: from izanami.macs.hw.ac.uk ([137.195.13.6]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IUGOi-0002ZM-As for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2007 02:35:56 -0400 Original-Received: from lxultra1.macs.hw.ac.uk ([137.195.27.173]:39608 helo=127.0.0.1) by izanami.macs.hw.ac.uk with smtp (Exim 4.51) id 1IUGOh-00021M-0z for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2007 07:35:55 +0100 Original-Received: (nullmailer pid 27689 invoked by uid 1001); Sun, 09 Sep 2007 06:35:54 -0000 User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:16511 Archived-At: 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 =E2=80=9CThis is the first paragraph of a multi-paragraph quote.=E2=80=9D. 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 =E2=80=9CParagraph being closed appears to contain a mismatch=E2=80=9D. The cause of the problem is that tex-terminate-paragraph is including the =E2=80=9C\begin{quote}=E2=80=9D in the text it checks for validity but = not the corresponding =E2=80=9C\end{quote}=E2=80=9D, causing an error when it uses forward-sexp to check for balance. It is an error to include the =E2=80=9C\begin{quote}=E2=80=9D because it is not part of the current parag= raph. 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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=3D/home/jbw/local2' '--enable-debug'= '--disable-nls' '--with-x-toolkit=3Dgtk' 'CFLAGS=3D-O0 -g3 -ggdb''