From unknown Mon Jun 23 13:12:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#38152: tex-mode: paragraph separator groups text and comments Resent-From: Michael Orlitzky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Nov 2019 14:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38152 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 38152@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.1573309757323 (code B ref -1); Sat, 09 Nov 2019 14:30:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Nov 2019 14:29:17 +0000 Received: from localhost ([127.0.0.1]:48368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iTRjo-000058-QF for submit@debbugs.gnu.org; Sat, 09 Nov 2019 09:29:17 -0500 Received: from lists.gnu.org ([209.51.188.17]:50587) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iTRjj-0008WV-00 for submit@debbugs.gnu.org; Sat, 09 Nov 2019 09:29:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41826) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTRjh-0000GL-O0 for bug-gnu-emacs@gnu.org; Sat, 09 Nov 2019 09:29:10 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_MED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iTRjf-0006dz-8P for bug-gnu-emacs@gnu.org; Sat, 09 Nov 2019 09:29:08 -0500 Received: from mail2.viabit.com ([65.246.80.16]:52254) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iTRjf-0006da-3K for bug-gnu-emacs@gnu.org; Sat, 09 Nov 2019 09:29:07 -0500 Received: from [172.17.29.8] (vpn1.metro-data.com [65.213.236.242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail2.viabit.com (Postfix) with ESMTPSA id 479KJf1jDCz4057 for ; Sat, 9 Nov 2019 09:29:05 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=orlitzky.com; s=mail2; t=1573309746; bh=nsqCfZ1cWtxyw8bML4QXG+QbV6m1rNia1EU3tHKWwsM=; h=To:From:Subject:Date; b=Hzys3LX//eJ/939ZyV5mpKj5KcdWM05n7VL+7W/o3RUhjpgnzBhiv92qK8om7pfLK B9Nm3foeOQ4iZd1ZRvD6oohUlBM42MDGLeAokI6Dm2NZDBHnnoe+e7TywyzvYA5XCH qwl177dmRiWs8Fw75rZSaF2py3BbSoOyJd0IaH8o= From: Michael Orlitzky Message-ID: <1c676915-8d09-34d4-36e6-ef29cb6ef8b5@orlitzky.com> Date: Sat, 9 Nov 2019 09:29:12 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 65.246.80.16 X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) 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]*\\($\\|" "\\\\[][]\\|" From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 11 20:26:29 2019 Received: (at control) by debbugs.gnu.org; 12 Nov 2019 01:26:29 +0000 Received: from localhost ([127.0.0.1]:56189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iUKwv-0004y3-41 for submit@debbugs.gnu.org; Mon, 11 Nov 2019 20:26:29 -0500 Received: from host.gofardesign.uk ([208.79.239.190]:48689) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iUKws-0004xn-Qe for control@debbugs.gnu.org; Mon, 11 Nov 2019 20:26:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Subject:From:To:Date:Sender:Reply-To:Message-ID:Cc:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=1mNNyUXwexC9JRfnBLKFQLg0hxMRz93wCx9gkTTDmO0=; b=C1aF3ZK0sdwbUxL7ZfsnnPP+Bq YRaDgzm0zLkqs5H+Wh1OW1Zex6C9VBMsgeTs8Bmx1OA9XQGrm1LsWVh7NnRhyJyYxNCaDfkUq23BD 1OcjWc6xVx/0U2xUOgsyRiqF4ueSIYP5M131ydhQlj7nYI7AguVdeZ+hidqe9IPvmimo=; Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:43914 helo=localhost) by host.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iUKwm-00058z-Tk for control@debbugs.gnu.org; Mon, 11 Nov 2019 19:26:21 -0600 Date: Tue, 12 Nov 2019 02:26:18 +0100 To: control@debbugs.gnu.org From: Stefan Kangas Subject: control message for bug #38152 X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: host.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: host.gofardesign.uk: stefan@marxist.se X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" Message-Id: X-Spam-Score: -1.0 (-) tags 38152 + patch quit From unknown Mon Jun 23 13:12:04 2025 X-Loop: help-debbugs@gnu.org Subject: bug#38152: tex-mode: paragraph separator groups text and comments Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Nov 2019 07:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38152 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Michael Orlitzky Cc: 38152@debbugs.gnu.org Received: via spool by 38152-submit@debbugs.gnu.org id=B38152.157388861817582 (code B ref 38152); Sat, 16 Nov 2019 07:17:02 +0000 Received: (at 38152) by debbugs.gnu.org; 16 Nov 2019 07:16:58 +0000 Received: from localhost ([127.0.0.1]:37655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iVsKI-0004ZC-0x for submit@debbugs.gnu.org; Sat, 16 Nov 2019 02:16:58 -0500 Received: from quimby.gnus.org ([95.216.78.240]:55594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iVsKG-0004Tz-No for 38152@debbugs.gnu.org; Sat, 16 Nov 2019 02:16:57 -0500 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iVsK8-0007DW-Eb; Sat, 16 Nov 2019 08:16:50 +0100 From: Lars Ingebrigtsen References: <1c676915-8d09-34d4-36e6-ef29cb6ef8b5@orlitzky.com> Date: Sat, 16 Nov 2019 08:16:47 +0100 In-Reply-To: <1c676915-8d09-34d4-36e6-ef29cb6ef8b5@orlitzky.com> (Michael Orlitzky's message of "Sat, 9 Nov 2019 09:29:12 -0500") Message-ID: <87pnhsgujk.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Michael Orlitzky writes: > 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/bugrepo [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: ingebrigtsen.no] -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Michael Orlitzky writes: > 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: Thanks; the patch fixes the issue in the example provided, at least (and it seems logical to me), so I've applied it to Emacs 27. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 16 02:17:03 2019 Received: (at control) by debbugs.gnu.org; 16 Nov 2019 07:17:03 +0000 Received: from localhost ([127.0.0.1]:37659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iVsKN-0004eQ-Br for submit@debbugs.gnu.org; Sat, 16 Nov 2019 02:17:03 -0500 Received: from quimby.gnus.org ([95.216.78.240]:55608) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iVsKL-0004XU-8z for control@debbugs.gnu.org; Sat, 16 Nov 2019 02:17:01 -0500 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iVsKD-0007Dd-P3 for control@debbugs.gnu.org; Sat, 16 Nov 2019 08:16:55 +0100 Date: Sat, 16 Nov 2019 08:16:53 +0100 Message-Id: <87o8xcguje.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #38152 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 38152 fixed close 38152 27.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 38152 fixed close 38152 27.1 quit