From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 09 10:58:57 2021 Received: (at submit) by debbugs.gnu.org; 9 Jun 2021 14:58:57 +0000 Received: from localhost ([127.0.0.1]:34402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lqzfV-0007k4-Bq for submit@debbugs.gnu.org; Wed, 09 Jun 2021 10:58:57 -0400 Received: from lists.gnu.org ([209.51.188.17]:55662) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lqzfT-0007jw-8K for submit@debbugs.gnu.org; Wed, 09 Jun 2021 10:58:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqzfS-00078m-SO for bug-auctex@gnu.org; Wed, 09 Jun 2021 10:58:54 -0400 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]:38621) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lqzfR-0005Jl-0Q for bug-auctex@gnu.org; Wed, 09 Jun 2021 10:58:54 -0400 Received: by mail-oi1-x236.google.com with SMTP id z3so25347551oib.5 for ; Wed, 09 Jun 2021 07:58:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:user-agent:from:to:subject:message-id:date:mime-version; bh=Mt5uCc8BSwBTjvU3e/4B9nFV0PlEM6LYQ4brxXFTx5Q=; b=kkz5vuNy99bH+TyA2lm5jUh3wtpOZ9Hwrba/7ewN836FWu4jUOSg54v3LBcvb04Urg 3sOhulNI0ygSLpdc4Gp9rytUGScbPMLMa5/fcc9bOj4ps/LO2P4+++OuuHBrG3OM6Qa5 ChEoyrskyMyoDW3xUmd65CtNnmoku/ASnJQGQWwq3bYSDdKSvhseC0qkAwFQYnjZjk1D H8WzJLlJhVgAkO3yDum6hZ7kW+p2KcXSwp108L95XflZ7QTo48mDCqEZvJ9SvMlImYO0 x/yi0LPxzU/kyHgj3xizV7r3Rz+V+sYtWY5GEwwpi4Mo+PyYwCp2wSUDjX+XZmUQH4u1 5HZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:user-agent:from:to:subject:message-id :date:mime-version; bh=Mt5uCc8BSwBTjvU3e/4B9nFV0PlEM6LYQ4brxXFTx5Q=; b=LFKB75qRL2/9cmBNpuPN9njK+Bxi5OncqxaSDfHJhK+G+LmkTHcASyX29wxuAPNYNP u351hjIaoAIHjVqpb4AeyCJP5oz3O1uH6LrdAiDp2ZPh1aGBD4vQdgewmhPYbtMwmLlO hwHFwfe+8+cqnWPq+j1XJv+zp0DQoXCeYQ+5earAiQ2TfMj8UrmDlUmCNX8uhSXzfXkD ol2xlun2PtFGn+rElA49x7y5rEQaiSmECJN2Mwl0PXHjwG/Kn3BYDOQzuCDwZcVXei9Y v+jy7aX5Nj3AOBkBncKoIEHj1bk+ei33YA5iSsmgH/qVxntyOxOF10lo0ZopBahAOyVC HEhQ== X-Gm-Message-State: AOAM532ZxUy9t1JQlHdAsTo/QxcMlZ7mjMRlavzmHj2acLP/0OpUghO2 /TbK1B8cNWPMxLkwVTn1qZhDrOrahNg= X-Google-Smtp-Source: ABdhPJyyvY96Zc4kqebRyFUx1CdTIuzT+iKNQpy50HanCFPSx2vaFUiSwQZaHE3B5J7YC5LvLPESbQ== X-Received: by 2002:aca:3986:: with SMTP id g128mr23954oia.159.1623250731227; Wed, 09 Jun 2021 07:58:51 -0700 (PDT) Received: from gusbrs-laptop ([143.244.34.233]) by smtp.gmail.com with ESMTPSA id h2sm1990316oog.16.2021.06.09.07.58.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 07:58:50 -0700 (PDT) User-agent: mu4e 1.4.15; emacs 27.2 From: Gustavo Barros To: bug-auctex@gnu.org Subject: 13.0.12; Paragraph filling with line that ends in % followed by comment Message-ID: <8735tr84pm.fsf@gmail.com> Date: Wed, 09 Jun 2021 11:58:46 -0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed Received-SPF: pass client-ip=2607:f8b0:4864:20::236; envelope-from=gusbrs.2016@gmail.com; helo=mail-oi1-x236.google.com X-Spam_score_int: 1 X-Spam_score: 0.1 X-Spam_bar: / X-Spam_report: (0.1 / 5.0 requ) BAYES_20=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit 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.1 (--) Hi All, When a paragraph containing a line whose text ends with a "legit" `\%' and is followed by a comment, paragraph filling joins the following paragraph content into the comment, when it shouldn't. An ECM to reproduce the issue is: start `emacs -Q'. Do an initial setup: #+begin_src emacs-lisp (add-to-list 'load-path "~/.emacs.d/elpa/auctex-13.0.12") (load "auctex.el" nil t t) (setq TeX-parse-self t) (setq TeX-auto-save t) #+end_src Visit a `.tex' file with contents ("|" represents point position): #+begin_src latex \documentclass{article} \begin{document} |Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. 35\% % FIXME check this number Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. \end{document} #+end_src and call `M-q'. The result is: #+begin_src latex \documentclass{article} \begin{document} |Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. 35\% % FIXME check this number Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. \end{document} #+end_src Resulting in the undesired effect of the rest of the paragraph being joined into the comment, of which it was not part before the filling. (Note that this message may get filled (format-flowed) by the MUA, so that the examples might not be immediately displayed as expected. Please take that into consideration. I do hope it is still understandable/reproducible.) Best regards, Gustavo. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 09 15:35:41 2021 Received: (at submit) by debbugs.gnu.org; 9 Jun 2021 19:35:41 +0000 Received: from localhost ([127.0.0.1]:34712 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lr3zI-0006fj-T4 for submit@debbugs.gnu.org; Wed, 09 Jun 2021 15:35:41 -0400 Received: from lists.gnu.org ([209.51.188.17]:41818) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lr3zF-0006fZ-Hh for submit@debbugs.gnu.org; Wed, 09 Jun 2021 15:35:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42508) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lr3zF-00053Z-9V for bug-auctex@gnu.org; Wed, 09 Jun 2021 15:35:37 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52702) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lr3zF-0007id-1p; Wed, 09 Jun 2021 15:35:37 -0400 Received: from auth1-smtp.messagingengine.com ([66.111.4.227]:54897) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lr3zE-0007W6-Vm; Wed, 09 Jun 2021 15:35:37 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 3299127C0054; Wed, 9 Jun 2021 15:35:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 09 Jun 2021 15:35:36 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeduuddgudefjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfhgfhffvufffjgfkgggtsehttd ertddtredtnecuhfhrohhmpefvrghsshhilhhoucfjohhrnhcuoehtshguhhesghhnuhdr ohhrgheqnecuggftrfgrthhtvghrnhepveevieekteekveeigfefffeivdetgeduvdffue euudevgedttdehvdfhueevfffhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomhepthhhohhrnhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlih hthidqkeeijeefkeejkeegqdeifeehvdelkedqthhsughhpeepghhnuhdrohhrghesfhgr shhtmhgrihhlrdhfmh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Jun 2021 15:35:34 -0400 (EDT) References: <8735tr84pm.fsf@gmail.com> User-agent: mu4e 1.5.13; emacs 28.0.50 From: Tassilo Horn To: Gustavo Barros Subject: Re: bug#48937: 13.0.12; Paragraph filling with line that ends in % followed by comment Date: Wed, 09 Jun 2021 21:05:43 +0200 In-reply-to: <8735tr84pm.fsf@gmail.com> Message-ID: <87czsuompo.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: bug-auctex@gnu.org, 48937@debbugs.gnu.org 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: -3.3 (---) Gustavo Barros writes: Hi Gustavo, > When a paragraph containing a line whose text ends with a "legit" `\%' > and is followed by a comment, paragraph filling joins the following > paragraph content into the comment, when it shouldn't. Indeed, that's a corner case nobody has bothered to handle yet. I've pushed a fix to master. Please give it a try. If you don't have a git checkout handy, you can also `eval-defun' the function below containing the fix. Bye, Tassilo --8<---------------cut here---------------start------------->8--- (defun LaTeX-fill-region-as-paragraph (from to &optional justify-flag) "Fill region as one paragraph. Break lines to fit `fill-column', but leave all lines ending with \\\\ \(plus its optional argument) alone. Lines with code comments and lines ending with `\\par' are included in filling but act as boundaries. Prefix arg means justify too. From program, pass args FROM, TO and JUSTIFY-FLAG. You can disable filling inside a specific environment by adding it to `LaTeX-indent-environment-list', only indentation is performed in that case." (interactive "*r\nP") (let ((end-marker (save-excursion (goto-char to) (point-marker)))) (if (or (assoc (LaTeX-current-environment) LaTeX-indent-environment-list) (member (TeX-current-macro) LaTeX-fill-excluded-macros) ;; This could be generalized, if there are more cases where ;; a special string at the start of a region to fill should ;; inhibit filling. (progn (save-excursion (goto-char from) (looking-at (concat TeX-comment-start-regexp "+[ \t]*" "Local Variables:"))))) ;; Filling disabled, only do indentation. (indent-region from to nil) (save-restriction (goto-char from) (while (< (point) end-marker) (if (re-search-forward (concat "\\(" ;; Code comments. "\\([^ \r\n%\\]\\|\\\\%\\)\\([ \t]\\|\\\\\\\\\\)*" "[^\r\n\\]" TeX-comment-start-regexp "\\|" ;; Lines ending with `\par'. "\\(\\=\\|[^" TeX-esc "\n]\\)\\(" (regexp-quote (concat TeX-esc TeX-esc)) "\\)*" (regexp-quote TeX-esc) "par[ \t]*" "\\({[ \t]*}\\)?[ \t]*$" "\\)\\|\\(" ;; Lines ending with `\\'. (regexp-quote TeX-esc) (regexp-quote TeX-esc) "\\(\\s-*\\*\\)?" "\\(\\s-*\\[[^]]*\\]\\)?" "\\s-*$\\)") end-marker t) (progn (goto-char (line-end-position)) (delete-horizontal-space) ;; I doubt very much if we want justify - ;; this is a line with \\ ;; if you think otherwise - uncomment the next line ;; (and justify-flag (justify-current-line)) (forward-char) ;; keep our position in a buffer (save-excursion ;; Code comments and lines ending with `\par' are ;; included in filling. Lines ending with `\\' are ;; skipped. (if (match-string 1) (LaTeX-fill-region-as-para-do from (point) justify-flag) (LaTeX-fill-region-as-para-do from (line-beginning-position 0) justify-flag) ;; At least indent the line ending with `\\'. (indent-according-to-mode))) (setq from (point))) ;; ELSE part follows - loop termination relies on a fact ;; that (LaTeX-fill-region-as-para-do) moves point past ;; the filled region (LaTeX-fill-region-as-para-do from end-marker justify-flag))))))) --8<---------------cut here---------------end--------------->8--- From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 09 21:11:52 2021 Received: (at submit) by debbugs.gnu.org; 10 Jun 2021 01:11:52 +0000 Received: from localhost ([127.0.0.1]:34887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lr9Ee-0002Jq-7R for submit@debbugs.gnu.org; Wed, 09 Jun 2021 21:11:52 -0400 Received: from lists.gnu.org ([209.51.188.17]:58738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lr9Eb-0002Jc-Lo for submit@debbugs.gnu.org; Wed, 09 Jun 2021 21:11:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lr9Eb-00079R-Cc for bug-auctex@gnu.org; Wed, 09 Jun 2021 21:11:49 -0400 Received: from mail-oo1-xc2c.google.com ([2607:f8b0:4864:20::c2c]:39775) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lr9EZ-0001BU-PT; Wed, 09 Jun 2021 21:11:49 -0400 Received: by mail-oo1-xc2c.google.com with SMTP id 67-20020a4a01460000b0290245b81f6261so6375082oor.6; Wed, 09 Jun 2021 18:11:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:references:user-agent:from:to:cc:subject:in-reply-to :message-id:date:mime-version; bh=5RYE/JNgpxviSMDVjmwpVHx2xvHG7ZwfMIZ5dqh0hfI=; b=SQZiXsvhZJYTWmJ/NE4+KdZPcIzEN9OVCAoIvVBLu+kSNAsOdySqVj37dS3XirmqWu i0X1vgeLHnn58KqLVdh1+vLh9JtjAOtydxxE1L4Jm+o4V0dzU4pd4lG9ttHccuM9Ct2c ngluycUzqQIwkTBEa6W9xW0wNokuRfkSOOkKpJioH9U3wwgun1F5kUkh7K3+A/lYkCLx lY8RDt15tYT7l1h2iUpcl/cLI8FkeyFUhjizzDHVF1qZVSI/2Dunc/0sc2M+GKtN3SG+ L8gd5hhbrWMLGbeL4Uhm3YAb8UJWI49b/mzgV6XqWwIiYCtT4zfmmxOpDn3v86MA7Mw8 WsVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject :in-reply-to:message-id:date:mime-version; bh=5RYE/JNgpxviSMDVjmwpVHx2xvHG7ZwfMIZ5dqh0hfI=; b=GZdFiwcAAUXb+mP25UWmXXnJdwyvTXXtnfrW+pjHDpmj4kfRsiUBOWSylp5cUUAjt5 72uthGZAOBPlwNAWtxKZ/FbSwvqeP+tIoMjV0/9+v3TMzTDHi2SztqPOUltmp+sN0YEV 1NfXF4Jwa7iL6PypnYhF7GoPCKqjwjonLfIgxVahQku1hY+OwSgoFF5KABMSZvE7peIS RqZBmWuaE1QH6/pUoUO9YAldOZDfH2/JGijIqJTz7xSoG8QMykpF7zs/zn2as81DtB4I 8JsknWr5qpGP7pCrgdeeayVpapPZZBQaJMvJo410XNSNtbKIQQ6c3vRfqWyFsfZQipPQ yZ5A== X-Gm-Message-State: AOAM5335H93hC6XJh2Lgzai9BwhSxMCezfkffP1dWT1oZntblSN342PI l0ZUREoKFDPXTeyWzQnWYi9jb1Vkhho= X-Google-Smtp-Source: ABdhPJxwaYYXXCBh98RfzYlTiYloaFhVmcH3mRyNJb6T86x4dPst5px8WmzFfCqTsJFoi/zv+SO0pA== X-Received: by 2002:a4a:e4c1:: with SMTP id w1mr380866oov.81.1623287505516; Wed, 09 Jun 2021 18:11:45 -0700 (PDT) Received: from gusbrs-laptop ([143.244.34.233]) by smtp.gmail.com with ESMTPSA id z6sm294070oiz.39.2021.06.09.18.11.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 18:11:44 -0700 (PDT) References: <8735tr84pm.fsf@gmail.com> <87czsuompo.fsf@gnu.org> User-agent: mu4e 1.4.15; emacs 27.2 From: Gustavo Barros To: Tassilo Horn Subject: Re: bug#48937: 13.0.12; Paragraph filling with line that ends in % followed by comment In-reply-to: <87czsuompo.fsf@gnu.org> Message-ID: <87y2biseur.fsf@gmail.com> Date: Wed, 09 Jun 2021 22:11:40 -0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed Received-SPF: pass client-ip=2607:f8b0:4864:20::c2c; envelope-from=gusbrs.2016@gmail.com; helo=mail-oo1-xc2c.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit Cc: bug-auctex@gnu.org, 48937@debbugs.gnu.org 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.1 (--) Hi Tassilo, On Wed, 09 Jun 2021 at 16:05, Tassilo Horn wrote: > Indeed, that's a corner case nobody has bothered to handle yet. I've > pushed a fix to master. Please give it a try. > > If you don't have a git checkout handy, you can also `eval-defun' the > function below containing the fix. Thank you very much for the quick answer and fix. I did try it out, and I admit that that regexp is a little daunting to me. But I was particularly not understanding why the "[^\r\n\\]" before `TeX-comment-start-regexp' in the patch. I still don't get its intent well, but I could get it to fail again by a small adjustment of the ECM, namely by removing the space between the `\%' and the comment character, so that we have `\%%'. This case fails to match because "[^\r\n\\]" must include one character before `TeX-comment-start-regexp'. #+begin_src latex \documentclass{article} \begin{document} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. 35\%% FIXME check this number Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. \end{document} #+end_src Bye, Gustavo. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 10 01:22:45 2021 Received: (at submit) by debbugs.gnu.org; 10 Jun 2021 05:22:45 +0000 Received: from localhost ([127.0.0.1]:35165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lrD9R-00005y-3S for submit@debbugs.gnu.org; Thu, 10 Jun 2021 01:22:45 -0400 Received: from lists.gnu.org ([209.51.188.17]:52032) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lrD9M-00005l-8t for submit@debbugs.gnu.org; Thu, 10 Jun 2021 01:22:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrD9M-0002QZ-2X for bug-auctex@gnu.org; Thu, 10 Jun 2021 01:22:40 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37516) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrD9L-0005cS-Mo; Thu, 10 Jun 2021 01:22:39 -0400 Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:32945) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrD9L-0006iK-KZ; Thu, 10 Jun 2021 01:22:39 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id ACD9327C0054; Thu, 10 Jun 2021 01:22:38 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 10 Jun 2021 01:22:38 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeduvddgledvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpehffgfhvffuffgjkfggtgesthdtre dttdertdenucfhrhhomhepvfgrshhsihhlohcujfhorhhnuceothhsughhsehgnhhurdho rhhgqeenucggtffrrghtthgvrhhnpeevveeikeetkeeviefgfeffiedvteeguddvffeuue duveegtddthedvhfeuveffhfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhep mhgrihhlfhhrohhmpehthhhorhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhith ihqdekieejfeekjeekgedqieefhedvleekqdhtshguhheppehgnhhurdhorhhgsehfrghs thhmrghilhdrfhhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 10 Jun 2021 01:22:37 -0400 (EDT) References: <8735tr84pm.fsf@gmail.com> <87czsuompo.fsf@gnu.org> <87y2biseur.fsf@gmail.com> User-agent: mu4e 1.5.13; emacs 28.0.50 From: Tassilo Horn To: Gustavo Barros Subject: Re: bug#48937: 13.0.12; Paragraph filling with line that ends in % followed by comment Date: Thu, 10 Jun 2021 07:20:16 +0200 In-reply-to: <87y2biseur.fsf@gmail.com> Message-ID: <87im2mwaxw.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: bug-auctex@gnu.org, 48937@debbugs.gnu.org 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: -3.3 (---) Gustavo Barros writes: Hi Gustavo, >> Indeed, that's a corner case nobody has bothered to handle yet. I've >> pushed a fix to master. Please give it a try. >> >> If you don't have a git checkout handy, you can also `eval-defun' the >> function below containing the fix. > > Thank you very much for the quick answer and fix. > > I did try it out, and I admit that that regexp is a little daunting to > me. But I was particularly not understanding why the "[^\r\n\\]" > before `TeX-comment-start-regexp' in the patch. Indeed, that was a leftover from playing with the regexp which isn't needed and produces the problem you describe below. > I still don't get its intent well, but I could get it to fail again by > a small adjustment of the ECM, namely by removing the space between > the `\%' and the comment character, so that we have `\%%'. Right. Should be fixed in git master or with the new definition below. --8<---------------cut here---------------start------------->8--- (defun LaTeX-fill-region-as-paragraph (from to &optional justify-flag) "Fill region as one paragraph. Break lines to fit `fill-column', but leave all lines ending with \\\\ \(plus its optional argument) alone. Lines with code comments and lines ending with `\\par' are included in filling but act as boundaries. Prefix arg means justify too. From program, pass args FROM, TO and JUSTIFY-FLAG. You can disable filling inside a specific environment by adding it to `LaTeX-indent-environment-list', only indentation is performed in that case." (interactive "*r\nP") (let ((end-marker (save-excursion (goto-char to) (point-marker)))) (if (or (assoc (LaTeX-current-environment) LaTeX-indent-environment-list) (member (TeX-current-macro) LaTeX-fill-excluded-macros) ;; This could be generalized, if there are more cases where ;; a special string at the start of a region to fill should ;; inhibit filling. (progn (save-excursion (goto-char from) (looking-at (concat TeX-comment-start-regexp "+[ \t]*" "Local Variables:"))))) ;; Filling disabled, only do indentation. (indent-region from to nil) (save-restriction (goto-char from) (while (< (point) end-marker) (if (re-search-forward (concat "\\(" ;; Code comments. "\\([^ \r\n%\\]\\|\\\\%\\)\\([ \t]\\|\\\\\\\\\\)*" TeX-comment-start-regexp "\\|" ;; Lines ending with `\par'. "\\(\\=\\|[^" TeX-esc "\n]\\)\\(" (regexp-quote (concat TeX-esc TeX-esc)) "\\)*" (regexp-quote TeX-esc) "par[ \t]*" "\\({[ \t]*}\\)?[ \t]*$" "\\)\\|\\(" ;; Lines ending with `\\'. (regexp-quote TeX-esc) (regexp-quote TeX-esc) "\\(\\s-*\\*\\)?" "\\(\\s-*\\[[^]]*\\]\\)?" "\\s-*$\\)") end-marker t) (progn (goto-char (line-end-position)) (delete-horizontal-space) ;; I doubt very much if we want justify - ;; this is a line with \\ ;; if you think otherwise - uncomment the next line ;; (and justify-flag (justify-current-line)) (forward-char) ;; keep our position in a buffer (save-excursion ;; Code comments and lines ending with `\par' are ;; included in filling. Lines ending with `\\' are ;; skipped. (if (match-string 1) (LaTeX-fill-region-as-para-do from (point) justify-flag) (LaTeX-fill-region-as-para-do from (line-beginning-position 0) justify-flag) ;; At least indent the line ending with `\\'. (indent-according-to-mode))) (setq from (point))) ;; ELSE part follows - loop termination relies on a fact ;; that (LaTeX-fill-region-as-para-do) moves point past ;; the filled region (LaTeX-fill-region-as-para-do from end-marker justify-flag))))))) --8<---------------cut here---------------end--------------->8--- Bye, Tassilo From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 10 07:01:47 2021 Received: (at submit) by debbugs.gnu.org; 10 Jun 2021 11:01:47 +0000 Received: from localhost ([127.0.0.1]:35551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lrIRX-0006ux-6l for submit@debbugs.gnu.org; Thu, 10 Jun 2021 07:01:47 -0400 Received: from lists.gnu.org ([209.51.188.17]:52302) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lrIRT-0006ua-Tj for submit@debbugs.gnu.org; Thu, 10 Jun 2021 07:01:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54392) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrIRT-00008V-HN for bug-auctex@gnu.org; Thu, 10 Jun 2021 07:01:43 -0400 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]:40466) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lrIRQ-0005Ke-OL; Thu, 10 Jun 2021 07:01:43 -0400 Received: by mail-ot1-x329.google.com with SMTP id l15-20020a05683016cfb02903fca0eacd15so3191268otr.7; Thu, 10 Jun 2021 04:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:references:user-agent:from:to:cc:subject:in-reply-to :message-id:date:mime-version; bh=ybaHpU7xBSBcAb7cuCZXEE8U4sWMb8nd+bL6Q2+2lpE=; b=VOjPr8E8RIxIQh3TT8MXPZjXj+rovtSN35O5twnZTdIHHXGFxjkWMAwxWlXoJ2vVCu Z9Aihj4rdETH5i2my1mFyAewI4Rl31XrkxRzdJ1jboEvQ70ZzVmavC3nrjvBYEuhjZVr EYljshFMhohX+5HTPlk62AxhxpyI0ztTqL/Uu7AGcgdeaYXXhySEPXnOvzYSWvob2oIo uLtmc8p+glQoKS6w8J5ag2QwLSzpJehFdkWxmUTX5IBnHtBNOsvnJga6OXyQBhYVvm3Q 0ojnCxe8Vyc9sy/yDLlqD95nJowvxmknIH4O+luydtU65FbOiTr4NWSQ09y8QTZh7c8X RiOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject :in-reply-to:message-id:date:mime-version; bh=ybaHpU7xBSBcAb7cuCZXEE8U4sWMb8nd+bL6Q2+2lpE=; b=R2+Hm86sAzZo7IqcwYr2GSAxRCTVqZvjWUrTJMbk5soHX/zi3SpHe7d26vhaySbFCt TRuHxHXFmIrgM9tT+Qu/CVbQgaNsjv4/JOoXMzWndqLWKwAAGbDkzMBSAPQCTuGHJ9vK fjO9zHF3rfk1Y+Qlkhs5AW1BdyXZuOgYR14lvicRSYLWE8+QmxOPiJVfS/ae4GsK5ZHN sXgPnw40UagsjeV4xtF0RgCfJ4MubohtIk1K4TgOHzm/B4LVXpeFiC7udkAJNsk7RV5W Q98GPjzhuYspC5oUbOp2jQZKAoty5QWBhu4Ow1O3XCD1X1nv8OUtp+QjaUqEzEeZLhOV hFew== X-Gm-Message-State: AOAM531P/oJeDj/+m/X//AhNp2u6UQSLtR/8FSUm5qoaQXzrr94C9zBS RBYeSEO+s6mFjp6Ac/zrk1hS7i7to9A= X-Google-Smtp-Source: ABdhPJzWndbSEc+NerM2CFG+utyCt5KOQxrphR8viE6cTkrwJ93Fki7ofnLXcxKIlUJCoAk5hIt0ng== X-Received: by 2002:a9d:226c:: with SMTP id o99mr1886652ota.134.1623322898359; Thu, 10 Jun 2021 04:01:38 -0700 (PDT) Received: from gusbrs-laptop ([143.244.34.233]) by smtp.gmail.com with ESMTPSA id e19sm473866oiw.24.2021.06.10.04.01.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jun 2021 04:01:37 -0700 (PDT) References: <8735tr84pm.fsf@gmail.com> <87czsuompo.fsf@gnu.org> <87y2biseur.fsf@gmail.com> <87im2mwaxw.fsf@gnu.org> User-agent: mu4e 1.4.15; emacs 27.2 From: Gustavo Barros To: Tassilo Horn Subject: Re: bug#48937: 13.0.12; Paragraph filling with line that ends in % followed by comment In-reply-to: <87im2mwaxw.fsf@gnu.org> Message-ID: <87v96mrnjn.fsf@gmail.com> Date: Thu, 10 Jun 2021 08:01:33 -0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed Received-SPF: pass client-ip=2607:f8b0:4864:20::329; envelope-from=gusbrs.2016@gmail.com; helo=mail-ot1-x329.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit Cc: bug-auctex@gnu.org, 48937@debbugs.gnu.org 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.1 (--) Hi Tassilo, On Thu, 10 Jun 2021 at 02:20, Tassilo Horn wrote: > Right. Should be fixed in git master or with the new definition > below. Now I do understand that part of the regexp. And it looks good to me. Thank you very much once again. Bye, Gustavo. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 10 07:42:21 2021 Received: (at submit) by debbugs.gnu.org; 10 Jun 2021 11:42:21 +0000 Received: from localhost ([127.0.0.1]:35615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lrJ4n-0001nS-1c for submit@debbugs.gnu.org; Thu, 10 Jun 2021 07:42:21 -0400 Received: from lists.gnu.org ([209.51.188.17]:53980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lrJ4i-0001nF-Al for submit@debbugs.gnu.org; Thu, 10 Jun 2021 07:42:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrJ4h-0007xS-WE for bug-auctex@gnu.org; Thu, 10 Jun 2021 07:42:16 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43668) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrJ4h-0005JZ-NJ; Thu, 10 Jun 2021 07:42:15 -0400 Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:57479) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrJ4h-0005VY-Gq; Thu, 10 Jun 2021 07:42:15 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id 229D527C005B; Thu, 10 Jun 2021 07:42:15 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 10 Jun 2021 07:42:15 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedufedggedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpehffgfhvffuffgjkfggtgesthdtre dttdertdenucfhrhhomhepvfgrshhsihhlohcujfhorhhnuceothhsughhsehgnhhurdho rhhgqeenucggtffrrghtthgvrhhnpeevveeikeetkeeviefgfeffiedvteeguddvffeuue duveegtddthedvhfeuveffhfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhep mhgrihhlfhhrohhmpehthhhorhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhith ihqdekieejfeekjeekgedqieefhedvleekqdhtshguhheppehgnhhurdhorhhgsehfrghs thhmrghilhdrfhhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 10 Jun 2021 07:42:14 -0400 (EDT) References: <8735tr84pm.fsf@gmail.com> <87czsuompo.fsf@gnu.org> <87y2biseur.fsf@gmail.com> <87im2mwaxw.fsf@gnu.org> <87v96mrnjn.fsf@gmail.com> User-agent: mu4e 1.5.13; emacs 28.0.50 From: Tassilo Horn To: Gustavo Barros Subject: Re: bug#48937: 13.0.12; Paragraph filling with line that ends in % followed by comment Date: Thu, 10 Jun 2021 13:41:39 +0200 In-reply-to: <87v96mrnjn.fsf@gmail.com> Message-ID: <87czsuvtd7.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: bug-auctex@gnu.org, 48937-done@debbugs.gnu.org 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: -3.3 (---) >> Right. Should be fixed in git master or with the new definition below. > > Now I do understand that part of the regexp. And it looks good to me. > Thank you very much once again. You are welcome. I'm closing this issue now. Bye, Tassilo From unknown Tue Aug 19 21:02:58 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 09 Jul 2021 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator