From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Arash Esbati Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Fri, 10 Feb 2023 08:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: 61400@debbugs.gnu.org X-Debbugs-Original-To: auctex-bugs Received: via spool by submit@debbugs.gnu.org id=B.16760191598105 (code B ref -1); Fri, 10 Feb 2023 08:53:01 +0000 Received: (at submit) by debbugs.gnu.org; 10 Feb 2023 08:52:39 +0000 Received: from localhost ([127.0.0.1]:34313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQP95-00026e-As for submit@debbugs.gnu.org; Fri, 10 Feb 2023 03:52:39 -0500 Received: from lists.gnu.org ([209.51.188.17]:56622) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQP92-00026U-3A for submit@debbugs.gnu.org; Fri, 10 Feb 2023 03:52:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQP91-0005RE-7n for bug-auctex@gnu.org; Fri, 10 Feb 2023 03:52:35 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQP90-0000RJ-P6 for bug-auctex@gnu.org; Fri, 10 Feb 2023 03:52:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=jaQanNnGlXWqF23jyEa7nkItEAIVd1w3l2qNO6Ft4L4=; b=ekO+tq2fPydeBZ iRFrq9/k60BX0Fbp+B35+JCw9ItAJ+sNG7t50+MesI+QOQ0NIBpmivzNOF6PoPNHaK7oMoGoE/ZmO oLlGsVDVn6zcdBhJoq2Hw5ARC34l8lsGfQVJYWoQ5OSbizdm09iFd0Ib8G48AYVJWofiicd4JXXW4 FzzxW57vulXFyiAc2rewwmHkAiZMYv83/Be3oiwLL/IxGyO9AbWiZ3+m1itUv9DBLbux6k1VDs72f QwVuyv/cftIlqVjFP2nyYQdgiFb/t4aowjRLR/j0ls8vwx/hfifQWG+nPd19OlJcTim/1p/tD2Sxe 3LennQ/7IiWOJKzuGwRw==; Received: from p5b326467.dip0.t-ipconnect.de ([91.50.100.103] helo=MUTANT) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQP90-0001lF-1x for bug-auctex@gnu.org; Fri, 10 Feb 2023 03:52:34 -0500 From: Arash Esbati Date: Fri, 10 Feb 2023 09:52:17 +0100 Message-ID: <86lel56gxq.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) 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 (---) Hi all, please set `TeX-parse-self' to t and load this small file: --8<---------------cut here---------------start------------->8--- \documentclass{article} \usepackage{url} \usepackage{fvextra} \begin{document} Now we can write some text foo and \path{bar} Now we can write some text foo and \path|bar| Now we can write some text foo and \Verb|bar| Now we can write some text foo and \Verb{bar} Now we can write some text foo and \verb|bar| \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% fill-column: 40 %%% End: --8<---------------cut here---------------end--------------->8--- Now mark the five lines and hit 'M-q'. I get: --8<---------------cut here---------------start------------->8--- \documentclass{article} \usepackage{url} \usepackage{fvextra} \begin{document} Now we can write some text foo and \path{bar} Now we can write some text foo and \path|bar| Now we can write some text foo and \Verb|bar| Now we can write some text foo and \Verb{bar} Now we can write some text foo and \verb|bar| \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% fill-column: 40 %%% End: --8<---------------cut here---------------end--------------->8--- Any idea what the reason is for the different break points? This is with Emacs 30 (emacs -Q) and latest AUCTeX from Git. TIA. Best, Arash From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Fri, 10 Feb 2023 09:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Arash Esbati Cc: 61400@debbugs.gnu.org X-Debbugs-Original-Cc: bug-auctex@gnu.org, 61400@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167602114611235 (code B ref -1); Fri, 10 Feb 2023 09:26:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 Feb 2023 09:25:46 +0000 Received: from localhost ([127.0.0.1]:34347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQPf8-0002v8-2F for submit@debbugs.gnu.org; Fri, 10 Feb 2023 04:25:46 -0500 Received: from lists.gnu.org ([209.51.188.17]:48496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQPf6-0002v1-6i for submit@debbugs.gnu.org; Fri, 10 Feb 2023 04:25:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQPev-00044k-Dt for bug-auctex@gnu.org; Fri, 10 Feb 2023 04:25:34 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQPev-0008Rp-11; Fri, 10 Feb 2023 04:25:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-reply-to:Date:Subject:To:From: References; bh=Ya/hevlT8OlciYtUXKjvSB+QTUVH2EujC9uyyTU/4Xk=; b=bfySG6Wl1IWkff 14Yy5n/6isz1jpgDmD8yvKoOHFs59N2EE+P1X7bYAdbKDemRlAHpP/f0/lfU9LiMMmCaQFnwUBetZ N4nTYq/hg9+XHfNq9NodBkSDoJBwSnih8S8104aR7pXS+SUk0OmCLS2wXUoPknml22trGrTnti/9A Hsn1b2UR/Cs7mf7RPtAE+eQKidNMUKQ7AV7Qetx12cdCT6BTEPzyQMlMoiZBrVe3M+/gCC8pYt7Wj I5+Pz3PHnpH6qPm3fgTMNk/nL5JZrFyvSUcnEWv0eGMrmQ5aC6c0GmkTJHlY2pGuG2wOM8IsYv843 FyZfFmOQaNAIoyTXOLzA==; Received: from auth1-smtp.messagingengine.com ([66.111.4.227]) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQPeu-0000X6-31; Fri, 10 Feb 2023 04:25:32 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id AEA4D27C0054; Fri, 10 Feb 2023 04:25:31 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 10 Feb 2023 04:25:31 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudehhedgtddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvvefuffgjkfggtgesthdtredttdertdenucfhrhhomhepvfgrshhs ihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucggtffrrghtthgvrhhnpe dujedtheduvdelffejkeetgedvheelhedvueefhfeukeekkeehvdfggeegffevgfenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhorhhnod hmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieejfeekjeekgedqieefhedv leekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilhdrfhhm X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Feb 2023 04:25:30 -0500 (EST) References: <86lel56gxq.fsf@gnu.org> User-agent: mu4e 1.9.19; emacs 30.0.50 From: Tassilo Horn Date: Fri, 10 Feb 2023 10:23:41 +0100 In-reply-to: <86lel56gxq.fsf@gnu.org> Message-ID: <87edqx7tyw.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) 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 (---) Arash Esbati writes: Hi Arash, > \begin{document} > > Now we can write some text foo and \path{bar} > > Now we can write some text foo and \path|bar| > > Now we can write some text foo and \Verb|bar| > > Now we can write some text foo and \Verb{bar} > > Now we can write some text foo and \verb|bar| > > \end{document} The different break point is already suggested when evaluating (LaTeX-fill-move-to-break-point (line-beginning-position)) at the end of each line. So that function is where to start edebugging. Bye, Tassilo From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Arash Esbati Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Fri, 10 Feb 2023 09:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Tassilo Horn Cc: 61400@debbugs.gnu.org X-Debbugs-Original-Cc: bug-auctex@gnu.org, 61400@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167602251213649 (code B ref -1); Fri, 10 Feb 2023 09:49:01 +0000 Received: (at submit) by debbugs.gnu.org; 10 Feb 2023 09:48:32 +0000 Received: from localhost ([127.0.0.1]:34360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQQ19-0003Y5-PY for submit@debbugs.gnu.org; Fri, 10 Feb 2023 04:48:32 -0500 Received: from lists.gnu.org ([209.51.188.17]:37346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQQ18-0003Xx-6V for submit@debbugs.gnu.org; Fri, 10 Feb 2023 04:48:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQQ17-00030D-Kr for bug-auctex@gnu.org; Fri, 10 Feb 2023 04:48:29 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQQ17-0004rm-1Y; Fri, 10 Feb 2023 04:48:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=+he2c5bfoO8c73wRVPmEu5op+DaOF7Ah8kkKuXib5SM=; b=UF+Mfkq1vp6BFUa41qFE y6LnqIQXNkIqsgW9/2mvllK1SIJUpqeP0X2RnkxR/jXDqn6TX1nNxkfVH8/9OgRWk5KdUDdMq0539 mRNMy3dHvgZ2eJAUBObpNmFKnFqeyJVMIPTzV79HFN73vmtJ1oAxiLdKWSr0cezaFd4y5vOVLXqYC uf4jkt5O2CFutclV64/iOBVKEjZSwt+d4kfjxJP26mdl1uS5Ntc+HZNMY2zlCdJsT3Dssn5+f7B5F gKBQofCt4ZDJhcfmu0asa9s6A9llXybLdXQqa470neFY1UY239ttudRv6wd2stfI98vMJyq/wJObg 6fRvWqQOnyNHCg==; Received: from p5b326467.dip0.t-ipconnect.de ([91.50.100.103] helo=MUTANT) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQQ16-0006El-7X; Fri, 10 Feb 2023 04:48:28 -0500 From: Arash Esbati In-Reply-To: <87edqx7tyw.fsf@gnu.org> (Tassilo Horn's message of "Fri, 10 Feb 2023 10:23:41 +0100") References: <86lel56gxq.fsf@gnu.org> <87edqx7tyw.fsf@gnu.org> Date: Fri, 10 Feb 2023 10:47:24 +0100 Message-ID: <86h6vt6edv.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) 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 (---) Tassilo Horn writes: > Arash Esbati writes: > >> \begin{document} >> >> Now we can write some text foo and \path{bar} >> >> Now we can write some text foo and \path|bar| >> >> Now we can write some text foo and \Verb|bar| >> >> Now we can write some text foo and \Verb{bar} >> >> Now we can write some text foo and \verb|bar| >> >> \end{document} > > The different break point is already suggested when evaluating > > (LaTeX-fill-move-to-break-point (line-beginning-position)) > > at the end of each line. So that function is where to start edebugging. Hi Tassilo, thanks for pushing me into that again. I did already but I missed what's happening in that function directly in the first form: (fill-move-to-break-point linebeg) It moves the point to different positions. In the example above, put point after \path{bar} and do: M-: (fill-move-to-break-point (line-beginning-position)) RET and the point before and. Now go after \verb|bar| and do the same, no is point after and. Can you reproduce this? Best, Arash From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Fri, 10 Feb 2023 10:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Arash Esbati Cc: 61400@debbugs.gnu.org X-Debbugs-Original-Cc: bug-auctex@gnu.org, 61400@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167602395216016 (code B ref -1); Fri, 10 Feb 2023 10:13:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 Feb 2023 10:12:32 +0000 Received: from localhost ([127.0.0.1]:34382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQQOO-0004AG-09 for submit@debbugs.gnu.org; Fri, 10 Feb 2023 05:12:32 -0500 Received: from lists.gnu.org ([209.51.188.17]:45892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQQOM-0004A8-Nj for submit@debbugs.gnu.org; Fri, 10 Feb 2023 05:12:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQQOM-00009n-HQ for bug-auctex@gnu.org; Fri, 10 Feb 2023 05:12:30 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQQOL-0001hw-L5; Fri, 10 Feb 2023 05:12:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-reply-to:Date:Subject:To:From: References; bh=FGZ/ppQbV7TS94d5WdYn+ZrDCnw7U09Ghk+EbIw233M=; b=CPiMP+Iw06BsGS OXsuVF0mDmhgmUU9u6XWy7ZPHUBRmQLFgCYS4UTFHE8XWXVFVfZGm1Is0sWijFOBFd3tepJDC/j0M vVaIM6pn+NrVR4NgUtwkp54DxJ2ysT9rcu8D2AM583DJwig72448VfgdhQ4AHA+H4C6A3nX5KlYJR Ty5F3HOmOSX9jkYITdp8LzZH4PaOsOdVjzIfWNEGu2uFYkSc9kz6CbPpDGa1zSgp/H6tPnuRCbJpj NxOup2f2t4PuIibqcZcTUzakmG/b6jVdLT/gepSIQmymQEdjIJ7L7CXqIuL86eVvdGn3J8pXDO7Oe +XDu9pQXy8Eq4wwMBVgw==; Received: from auth1-smtp.messagingengine.com ([66.111.4.227]) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQQOL-0003mK-87; Fri, 10 Feb 2023 05:12:29 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 1CBB027C005B; Fri, 10 Feb 2023 05:12:28 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 10 Feb 2023 05:12:28 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudehhedguddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvvefuffgjkfggtgesthdtredttdertdenucfhrhhomhepvfgrshhs ihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucggtffrrghtthgvrhhnpe dujedtheduvdelffejkeetgedvheelhedvueefhfeukeekkeehvdfggeegffevgfenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhorhhnod hmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieejfeekjeekgedqieefhedv leekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilhdrfhhm X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Feb 2023 05:12:27 -0500 (EST) References: <86lel56gxq.fsf@gnu.org> <87edqx7tyw.fsf@gnu.org> <86h6vt6edv.fsf@gnu.org> User-agent: mu4e 1.9.19; emacs 30.0.50 From: Tassilo Horn Date: Fri, 10 Feb 2023 11:03:27 +0100 In-reply-to: <86h6vt6edv.fsf@gnu.org> Message-ID: <87a61l7rsm.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) 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 (---) Arash Esbati writes: > thanks for pushing me into that again. I did already but I missed > what's happening in that function directly in the first form: > > (fill-move-to-break-point linebeg) > > It moves the point to different positions. In the example above, put > point after \path{bar} and do: > > M-: (fill-move-to-break-point (line-beginning-position)) RET > > and the point before and. Now go after \verb|bar| and do the same, no > is point after and. Can you reproduce this? Yes, I can. BTW, only the last sentence is broken correctly, all others are wrapped around at a too early position. Hm, (fill-nobreak-p) returns nil only on the \ of the \verb|bar| but returns non-nil on each \ of the other verbatim macros. (I can't look any further now so it's your turn again. ;-)) Bye, Tassilo From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Ikumi Keita Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Fri, 10 Feb 2023 10:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Tassilo Horn Cc: 61400@debbugs.gnu.org X-Debbugs-Original-Cc: bug-auctex@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167602603120992 (code B ref -1); Fri, 10 Feb 2023 10:48:01 +0000 Received: (at submit) by debbugs.gnu.org; 10 Feb 2023 10:47:11 +0000 Received: from localhost ([127.0.0.1]:34401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQQvu-0005SW-Sb for submit@debbugs.gnu.org; Fri, 10 Feb 2023 05:47:11 -0500 Received: from lists.gnu.org ([209.51.188.17]:54406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQQvt-0005SO-0m for submit@debbugs.gnu.org; Fri, 10 Feb 2023 05:47:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQQvs-0002mF-MX for bug-auctex@gnu.org; Fri, 10 Feb 2023 05:47:08 -0500 Received: from smtp1a.inetd.co.jp ([210.129.88.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQQvq-0001XO-JL; Fri, 10 Feb 2023 05:47:08 -0500 Received: from localhost (42-144-46-173.rev.home.ne.jp [42.144.46.173]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id 090EC60; Fri, 10 Feb 2023 19:46:59 +0900 (JST) From: Ikumi Keita In-reply-to: <87a61l7rsm.fsf@gnu.org> References: <86lel56gxq.fsf@gnu.org> <87edqx7tyw.fsf@gnu.org> <86h6vt6edv.fsf@gnu.org> <87a61l7rsm.fsf@gnu.org> Comments: In-reply-to Tassilo Horn message dated "Fri, 10 Feb 2023 11:03:27 +0100." X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 28.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <73628.1676026018.1@localhost> Content-Transfer-Encoding: quoted-printable Date: Fri, 10 Feb 2023 19:46:58 +0900 Message-ID: <73630.1676026018@localhost> Received-SPF: pass client-ip=210.129.88.11; envelope-from=ikumi@ikumi.que.jp; helo=smtp1a.inetd.co.jp X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) 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.3 (--) >>>>> Tassilo Horn writes: >> It moves the point to different positions. In the example above, put >> point after \path{bar} and do: >> = >> M-: (fill-move-to-break-point (line-beginning-position)) RET >> = >> and the point before and. Now go after \verb|bar| and do the same, no >> is point after and. Can you reproduce this? > Yes, I can. I can as well. > Hm, (fill-nobreak-p) returns nil only on the \ of the \verb|bar| but > returns non-nil on each \ of the other verbatim macros. (I can't look > any further now so it's your turn again. ;-)) I did repeated edebug and found that `LaTeX-verbatim-p' is the culprit. When the point is just before \path{bar}, (LaTeX-verbatim-p) returns non-nil and `fill-nobreak-bredicate' hook tells "Don't break here". On the other hand, if the poinst is just before \verb|bar|, (LaTeX-verbatim-p) returns nil. Here is current definition of `LaTeX-verbatim-p': ,---- | (defun LaTeX-verbatim-p (&optional pos) | "Return non-nil if position POS is in a verbatim-like construct." | (when pos (goto-char pos)) | (save-match-data | (or (progn | (syntax-propertize (point)) | (nth 3 (syntax-ppss))) | (member (LaTeX-current-verbatim-macro) | (LaTeX-verbatim-macros-with-delims)) | (member (TeX-current-macro) (LaTeX-verbatim-macros-with-braces)) | (member (LaTeX-current-environment) (LaTeX-verbatim-environments= ))))) `---- After all, the difference comes from subtle difference between `LaTeX-current-verbatim-macro' and `TeX-current-macro'. When the point is just before the leading backslash, they returns: | path | verb | -----------------------------+-------+-------| LaTeX-current-verbatim-macro | "" | "" | TeX-current-macro | "path"| "verb"| In this context, it doesn't seem appropriate `TeX-current-macro' returns non-nil. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Arash Esbati Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Fri, 10 Feb 2023 11:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Tassilo Horn Cc: 61400@debbugs.gnu.org X-Debbugs-Original-Cc: bug-auctex@gnu.org, 61400@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167602929227066 (code B ref -1); Fri, 10 Feb 2023 11:42:01 +0000 Received: (at submit) by debbugs.gnu.org; 10 Feb 2023 11:41:32 +0000 Received: from localhost ([127.0.0.1]:34436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQRmW-00072U-6z for submit@debbugs.gnu.org; Fri, 10 Feb 2023 06:41:32 -0500 Received: from lists.gnu.org ([209.51.188.17]:53580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQRmV-00072M-Ee for submit@debbugs.gnu.org; Fri, 10 Feb 2023 06:41:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQRmV-0000YB-4O for bug-auctex@gnu.org; Fri, 10 Feb 2023 06:41:31 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQRmU-00074Q-PR; Fri, 10 Feb 2023 06:41:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=//Lr0c/pMssuGQGZ+e1TtPIrFaXt2ueitVYV6iz0808=; b=fO7JIf1Q794BYpPXzj9G 1gojte+47iZxvX5hBGzZM9ul/HLuO4604aM7txCwdt9JyGmNWddoRSAmNm5i4Gdvgdlk69soXoMin PvNvK6Zya9hJD1vd0MIUiFIHbmFrl7znuKUfmUC/8GFkmeH4Ma6guZnS5enUb5bFIkFiu1Qydnat3 Ryw9+8U85fSMkSJ+VgqwvjcZE+rZuQT7lEiuelk2d6qsBdtPZ3nFk+XzNv746MYJqmIcknbfSp3yB nZJ+8YrVlHINaxwW2S13ot77lYEgVhhc/ykDVHKGDHsBPiNMuTLh3Z+EkbEMgCLfcgfOR/10SfxI8 YfagJQ+JoHnKGA==; Received: from p5b326467.dip0.t-ipconnect.de ([91.50.100.103] helo=MUTANT) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQRmU-00074j-1j; Fri, 10 Feb 2023 06:41:30 -0500 From: Arash Esbati In-Reply-To: <87a61l7rsm.fsf@gnu.org> (Tassilo Horn's message of "Fri, 10 Feb 2023 11:03:27 +0100") References: <86lel56gxq.fsf@gnu.org> <87edqx7tyw.fsf@gnu.org> <86h6vt6edv.fsf@gnu.org> <87a61l7rsm.fsf@gnu.org> Date: Fri, 10 Feb 2023 12:41:12 +0100 Message-ID: <86sffdvjc7.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) 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 (---) Tassilo Horn writes: > Yes, I can. BTW, only the last sentence is broken correctly, all others > are wrapped around at a too early position. Thanks for checking. > Hm, (fill-nobreak-p) returns nil only on the \ of the \verb|bar| but > returns non-nil on each \ of the other verbatim macros. (I can't look > any further now so it's your turn again. ;-)) I think I've got it: `LaTeX-verbatim-p' does its job as a predicate, but for filling, it should only return non-nil when point is inside the argument, and not when point is in front of the \verb macro itself, this is what `fill-move-to-break-point' does. Try this file: Eval the forms and then fill the other lines. --8<---------------cut here---------------start------------->8--- \documentclass{article} \usepackage{url} \usepackage{fvextra} \begin{document} \begin{verbatim} (defun LaTeX-verbatim-nobreak-p (&optional pos) "Return non-nil if position POS is in a verbatim-like construct." (when pos (goto-char pos)) (save-match-data (or (progn (syntax-propertize (point)) (nth 3 (syntax-ppss))) (member (LaTeX-current-verbatim-macro) (append (LaTeX-verbatim-macros-with-delims) (LaTeX-verbatim-macros-with-braces)))))) (setq-local fill-nobreak-predicate #'LaTeX-verbatim-nobreak-p) \end{verbatim} Now we can write some text foo and \path|bar| Now we can write some text foo and \path|bar| Now we can write some text foo and \Verb{bar} Now we can write some text foo and \Verb|bar| Now we can write some text foo and \verb|bar| \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% fill-column: 40 %%% End: --8<---------------cut here---------------end--------------->8--- From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Ikumi Keita Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Sat, 11 Feb 2023 08:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Arash Esbati , Tassilo Horn Cc: 61400@debbugs.gnu.org Received: via spool by 61400-submit@debbugs.gnu.org id=B61400.16761057617665 (code B ref 61400); Sat, 11 Feb 2023 08:57:01 +0000 Received: (at 61400) by debbugs.gnu.org; 11 Feb 2023 08:56:01 +0000 Received: from localhost ([127.0.0.1]:38636 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQlft-0001zM-7G for submit@debbugs.gnu.org; Sat, 11 Feb 2023 03:56:01 -0500 Received: from smtp1a.inetd.co.jp ([210.129.88.11]:53204) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQlfq-0001z5-VO for 61400@debbugs.gnu.org; Sat, 11 Feb 2023 03:56:00 -0500 Received: from localhost (42-144-46-173.rev.home.ne.jp [42.144.46.173]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id C53C95C; Sat, 11 Feb 2023 17:55:56 +0900 (JST) From: Ikumi Keita In-reply-to: <86sffdvjc7.fsf@gnu.org> References: <86lel56gxq.fsf@gnu.org> <87edqx7tyw.fsf@gnu.org> <86h6vt6edv.fsf@gnu.org> <87a61l7rsm.fsf@gnu.org> <86sffdvjc7.fsf@gnu.org> Comments: In-reply-to Arash Esbati message dated "Fri, 10 Feb 2023 12:41:12 +0100." X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 28.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <77897.1676105751.1@localhost> Content-Transfer-Encoding: quoted-printable Date: Sat, 11 Feb 2023 17:55:52 +0900 Message-ID: <77898.1676105752@localhost> 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 (-) Hi all, >>>>> Arash Esbati writes: > Tassilo Horn writes: >> Hm, (fill-nobreak-p) returns nil only on the \ of the \verb|bar| but >> returns non-nil on each \ of the other verbatim macros. (I can't look >> any further now so it's your turn again. ;-)) > I think I've got it: `LaTeX-verbatim-p' does its job as a predicate, but > for filling, it should only return non-nil when point is inside the > argument, and not when point is in front of the \verb macro itself, this > is what `fill-move-to-break-point' does. I realized that multiple players are involved in this issue. Let's see how they interact: Usually `LaTeX-verbatim-macro-boundaries' returns cons (BEG . END) where BEG is the point just before the leading backslash of \verb etc. However, there are inconsistencies when the point is at just before the leading backslash; When "\verb..." is at beginning of a line, return value is nil: -!-\verb+abc+ ... (LaTeX-verbatim-macro-boundaries) -> nil Otherwize, BEG is not the point just before the leading backslash, but less than that value by 1: xyz -!-\verb+abc+ ... (car (LaTeX-verbatim-macro-boundaries)) -> the point just after the "z" For this reason, `LaTeX-current-verbatim-macro' doesn't behave consistently. It returns nil in the former case while the null string "" in the latter. -!-\verb+abc+ ... (LaTeX-current-verbatim-macro) -> nil xyz -!-\verb+abc+ ... (LaTeX-current-verbatim-macro) -> "" Here is the origin of the inconsistency. ---------------------------------------------------------------------- (defun LaTeX-verbatim-macro-boundaries () [...] ;; Search backwards for the macro start, unless we are facing one (unless (looking-at (concat (regexp-quote TeX-esc) verbatim-regexp))= --- (1) (catch 'found (while (progn (skip-chars-backward (concat "^\n" (regexp-quote TeX-es= c)) (line-beginning-position)) (when (looking-at verbatim-regexp) (throw 'found nil)) = --- (2) (or (bobp) (forward-char -1)) (/=3D (point) (line-beginning-position)))))) ;; Search forward for the macro end, unless we failed to find a star= t (unless (bolp) --= - (3) (let* ((beg (1- (point))) [...] (cons beg (1+ (point))))))))) ---------------------------------------------------------------------- When the point is just before the leading backslash, `looking-at' at (1) matches and emacs skips to (3). But the block after (3) expects that the point is just _after_ the leading backslash, as the rest of the code exhibits. Actually, `looking-at' at (2) doesn't include backslash, so emacs proceeds to (3) with the point at just _after_ the leading backslash when (2) matches. We can fix this inconsistency by the following code: ---------------------------------------------------------------------- (defun LaTeX-verbatim-macro-boundaries () [...] ;; Search backwards for the macro start, unless we are facing one (if (looking-at (concat (regexp-quote TeX-esc) verbatim-regexp)) (forward-char 1) (catch 'found [...] ---------------------------------------------------------------------- With this fix, `LaTeX-current-verbatim-macro' returns sane result even when the point is just before "\verb". It just behave like `TeX-current-macro'. However, the story continues. With the above fix, Arash's original example provides Now we can write some text foo and \path{bar} Now we can write some text foo and \path|bar| Now we can write some text foo and \Verb|bar| Now we can write some text foo and \Verb{bar} Now we can write some text foo and \verb|bar| Yes, the behavior becomes coherent, but in the undesired direction. :-( As Arash wrote, the reason is that `LaTeX-verbatim-p' returns non-nil just before the leading backslashes for all these cases. ---------------------------------------------------------------------- (defun LaTeX-verbatim-p (&optional pos) [...] (or (progn --- (4) (syntax-propertize (point)) --- (4) (nth 3 (syntax-ppss))) --- (4) (member (LaTeX-current-verbatim-macro) -= -- (5) (LaTeX-verbatim-macros-with-delims)) -= -- (5) (member (TeX-current-macro) (LaTeX-verbatim-macros-with-braces)) -= -- (5) (member (LaTeX-current-environment) (LaTeX-verbatim-environments))= ))) ---------------------------------------------------------------------- The block (4) returns nil when the point is just before the beginning of quoted region. However, (5) returns non-nil when the point is just before the verbatim macro. This isn't suitable for predicate of filling. For consistency, maybe we should modify `TeX-current-macro' and `LaTeX-current-verbatim-macro' so that they return nil when the point is just before the verbatim macro. However, I'm not yet sure whether such change brings about bad side effects. Perhaps the safe fix is to tweak `TeX-current-macro' and `LaTeX-current-verbatim-macro' so that they accept optional argument for use in `LaTeX-verbatim-p'? (By the way, = (member (LaTeX-current-verbatim-macro) (LaTeX-verbatim-macros-with-delims)) is a bit inefficient because `LaTeX-current-verbatim-macro' only responds to macros included in `(LaTeX-verbatim-macros-with-delims)' for the first place.) Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Arash Esbati Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Sun, 12 Feb 2023 13:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Ikumi Keita Cc: 61400@debbugs.gnu.org, Tassilo Horn Received: via spool by 61400-submit@debbugs.gnu.org id=B61400.167620762114708 (code B ref 61400); Sun, 12 Feb 2023 13:14:02 +0000 Received: (at 61400) by debbugs.gnu.org; 12 Feb 2023 13:13:41 +0000 Received: from localhost ([127.0.0.1]:44366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRCAm-0003pA-H9 for submit@debbugs.gnu.org; Sun, 12 Feb 2023 08:13:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRCAk-0003or-3O for 61400@debbugs.gnu.org; Sun, 12 Feb 2023 08:13:38 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRCAd-0001GK-0l; Sun, 12 Feb 2023 08:13:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=4hcCjiXgHyryws+/kxeaHdiYcZngVjLYD49llVtTdxo=; b=FWYZSy9LDKtvgNRAZcuw N9xeYxq+E9Dp6bUvQCgWgR2IHTDyP0Zr7ma9pGxGm0LVmwSlHiYYsWFbvmHTBYStXowWNivDVD6ss Frjn1muPXRh/X56LaqXYgmVQVmc4UPUsL0I5nKitHgI1uBRCIHCtG4b8IR3PZaY7sABqiOjNRwuiv pGKSSUoQuOgn6bNItodRgGoFAAM3uIY9KUCTPF0TLoLPjza1WqCKZZfdVfRZjURpnyRsyoQQ9zue5 E/7VoSq4/1798oOPSjvAo8rN2FgNP003vgHKQuYsU7ZxQNA4OU8oAUyXlXjt/dbKVCnfjcXkQfpNU x+oEzYrG3SKaIg==; Received: from p5b326467.dip0.t-ipconnect.de ([91.50.100.103] helo=MUTANT) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRCAc-00060o-D6; Sun, 12 Feb 2023 08:13:30 -0500 From: Arash Esbati In-Reply-To: <77898.1676105752@localhost> (Ikumi Keita's message of "Sat, 11 Feb 2023 17:55:52 +0900") References: <86lel56gxq.fsf@gnu.org> <87edqx7tyw.fsf@gnu.org> <86h6vt6edv.fsf@gnu.org> <87a61l7rsm.fsf@gnu.org> <86sffdvjc7.fsf@gnu.org> <77898.1676105752@localhost> Date: Sun, 12 Feb 2023 12:18:31 +0100 Message-ID: <86o7pzku7s.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) 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 (---) Hi Keita, Ikumi Keita writes: > I realized that multiple players are involved in this issue. First of all, many thanks for your (as always) precise analysis =F0=9F=99= =8F=F0=9F=8F=BF > We can fix this inconsistency by the following code: > ---------------------------------------------------------------------- > (defun LaTeX-verbatim-macro-boundaries () > [...] > ;; Search backwards for the macro start, unless we are facing one > (if (looking-at (concat (regexp-quote TeX-esc) verbatim-regexp)) > (forward-char 1) > (catch 'found > [...] > ---------------------------------------------------------------------- > With this fix, `LaTeX-current-verbatim-macro' returns sane result even > when the point is just before "\verb". It just behave like > `TeX-current-macro'. I think this should be our course of action: Make `LaTeX-current-verbatim-macro' and `TeX-current-macro' work identical. > Yes, the behavior becomes coherent, but in the undesired direction. :-( We should take that. > For consistency, maybe we should modify `TeX-current-macro' and > `LaTeX-current-verbatim-macro' so that they return nil when the point is > just before the verbatim macro. However, I'm not yet sure whether such > change brings about bad side effects. I agree, we shouldn't touch `TeX-current-macro'. > Perhaps the safe fix is to tweak `TeX-current-macro' and > `LaTeX-current-verbatim-macro' so that they accept optional argument for > use in `LaTeX-verbatim-p'? Here is another idea: We don't use `LaTeX-verbatim-p' in `fill-nobreak-predicate', but define two new functions, say `LaTeX-verbatim-macro-arg-boundaries' and `LaTeX-verbatim-nobreak-p'. The first one is carved out of `LaTeX-verbatim-macro-boundaries' and returns the beginning and end positions of the argument, as the name suggests. And `LaTeX-verbatim-nobreak-p' does the following: Check if the possible break point for filling is inside the range returned by `LaTeX-verbatim-macro-arg-boundaries' and if `LaTeX-current-verbatim-macro' on that point returns non-nil, then inhibit break there (t value), otherwise allow brake (nil value.) WDYT, does this make sense? Best, Arash From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Ikumi Keita Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Sun, 12 Feb 2023 15:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Arash Esbati Cc: 61400@debbugs.gnu.org, Tassilo Horn Received: via spool by 61400-submit@debbugs.gnu.org id=B61400.167621593330374 (code B ref 61400); Sun, 12 Feb 2023 15:33:02 +0000 Received: (at 61400) by debbugs.gnu.org; 12 Feb 2023 15:32:13 +0000 Received: from localhost ([127.0.0.1]:46447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pREKq-0007tp-VG for submit@debbugs.gnu.org; Sun, 12 Feb 2023 10:32:13 -0500 Received: from smtp1a.inetd.co.jp ([210.129.88.11]:55224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pREKn-0007td-Kg for 61400@debbugs.gnu.org; Sun, 12 Feb 2023 10:32:11 -0500 Received: from localhost (42-144-46-173.rev.home.ne.jp [42.144.46.173]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id 541CF5C; Mon, 13 Feb 2023 00:32:07 +0900 (JST) From: Ikumi Keita In-reply-to: <86o7pzku7s.fsf@gnu.org> References: <86lel56gxq.fsf@gnu.org> <87edqx7tyw.fsf@gnu.org> <86h6vt6edv.fsf@gnu.org> <87a61l7rsm.fsf@gnu.org> <86sffdvjc7.fsf@gnu.org> <77898.1676105752@localhost> <86o7pzku7s.fsf@gnu.org> Comments: In-reply-to Arash Esbati message dated "Sun, 12 Feb 2023 12:18:31 +0100." X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 28.2 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Date: Mon, 13 Feb 2023 00:32:06 +0900 Message-ID: <87312.1676215926@localhost> 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 (-) --=-=-= Content-Type: text/plain Hi Arash and all, >>>>> Arash Esbati writes: > I think this should be our course of action: Make > `LaTeX-current-verbatim-macro' and `TeX-current-macro' work identical. I'm now thinking a different approach. Please see below. > Here is another idea: We don't use `LaTeX-verbatim-p' in > `fill-nobreak-predicate', but define two new functions, say > `LaTeX-verbatim-macro-arg-boundaries' and `LaTeX-verbatim-nobreak-p'. > The first one is carved out of `LaTeX-verbatim-macro-boundaries' and > returns the beginning and end positions of the argument, as the name > suggests. > And `LaTeX-verbatim-nobreak-p' does the following: Check if the possible > break point for filling is inside the range returned by > `LaTeX-verbatim-macro-arg-boundaries' and if > `LaTeX-current-verbatim-macro' on that point returns non-nil, then > inhibit break there (t value), otherwise allow brake (nil value.) > WDYT, does this make sense? Looking at the current code closely, I think we can take a more drastic route. :-) (1) `LaTeX-current-verbatim-macro' is used only in `LaTeX-verbatim-p': ,---- | > git grep -E LaTeX-current-verbatim-macro | ChangeLog.1: (LaTeX-current-verbatim-macro): Include asterisk, if present, in | ChangeLog.1: (LaTeX-verbatim-macro-boundaries, LaTeX-current-verbatim-macro) | latex.el:(defun LaTeX-current-verbatim-macro () | latex.el: (member (LaTeX-current-verbatim-macro) `---- And `LaTeX-verbatim-macro-boundaries' is used only in `LaTeX-current-verbatim-macro': ,---- | > git grep -E LaTeX-verbatim-macro-boundaries | ChangeLog.1: * latex.el (LaTeX-verbatim-macro-boundaries): Support verbatim | ChangeLog.1: * latex.el (LaTeX-verbatim-macro-boundaries): Do step backwards | at | ChangeLog.1: (LaTeX-verbatim-macro-boundaries): Find macro in case point is | ChangeLog.1: (LaTeX-verbatim-macro-boundaries, LaTeX-current-verbatim-macro) | latex.el:(defun LaTeX-verbatim-macro-boundaries () | latex.el: (let ((macro-boundaries (LaTeX-verbatim-macro-boundaries))) `---- Those two functions are practically dedicated to `LaTeX-verbatim-p'. Hence we can be rather flexible about what we do for them. (2) `LaTeX-verbatim-p' is currently used only in `fill-nobreak-predicate', `LaTeX-search-forward-comment-start' and `TeX-in-comment' (through `TeX-verbatim-p-function'): ,---- | > git grep -E LaTeX-verbatim-p | ChangeLog.1: (LaTeX-verbatim-p): Doc fix. Correct macro lookup. | ChangeLog.1: * style/verbatim.el (LaTeX-verbatim-package-options): New | ChangeLog.1: (LaTeX-verbatim-p, LaTeX-search-forward-comment-start): New | latex.el:(defun LaTeX-verbatim-p (&optional pos) | latex.el: (not (LaTeX-verbatim-p))) | latex.el: #'LaTeX-verbatim-p t) | latex.el: (setq TeX-verbatim-p-function #'LaTeX-verbatim-p) | style/verbatim.el:(defvar LaTeX-verbatim-package-options nil `---- Thus it's safe to modify `LaTeX-verbatim-p' to return nil at just before "\verb|...|" etc. by the following reasons: o In `LaTeX-search-forward-comment-start', `LaTeX-verbatim-p' is always called just before % sign. o In `TeX-in-comment', `LaTeX-verbatim-p' is always called in a comment. (3) I began to feel unsatisfied that `LaTeX-verbatim-p' needs the check for `LaTeX-verbatim-macros-with-braces' in addition to `LaTeX-current-verbatim-macro': ---------------------------------------------------------------------- (defun LaTeX-verbatim-p (&optional pos) [...] (member (LaTeX-current-verbatim-macro) (LaTeX-verbatim-macros-with-delims)) (member (TeX-current-macro) (LaTeX-verbatim-macros-with-braces)) <--- Here (member (LaTeX-current-environment) (LaTeX-verbatim-environments))))) ---------------------------------------------------------------------- Why can't `LaTeX-current-verbatim-macro' check both *-delims and *-braces at the same time? Its name suggests it _should_ be able to handle either type. Looking at the contents of `LaTeX-verbatim-macro-boundaries', I came to think that this is due to insufficient implementation: ---------------------------------------------------------------------- (defun LaTeX-verbatim-macro-boundaries () [...] ;; Heuristic: If an opening brace is encountered, search for ;; both the opening and the closing brace as an end marker. ;; Like that the function should work for \verb|...| as well ;; as for \url{...}. (when (string= delimiter TeX-grop) (setq delimiter (concat delimiter TeX-grcl))) (goto-char (1+ macro-end)) (skip-chars-forward (concat "^" delimiter)) ---------------------------------------------------------------------- This portion obviously indicates that this function is actually intended for both *-delims and *-braces types of verbatim macros. Thus the line (verbatim-regexp (regexp-opt (LaTeX-verbatim-macros-with-delims) t))) , a bit above the quoted portion, should actually include *-braces as well. Then `LaTeX-verbatim-macro-boundaries' becomes able to handle both *-delims and *-braces, and thus `LaTeX-current-verbatim-macro' does, too. In addition, we don't have to keep the symmetric behavior of `LaTeX-current-verbatim-macro' and `TeX-current-macro', given what I wrote in (1). So we can modify `LaTeX-verbatim-macro-boundaries' so that it returns nil at just before "\verb..." etc. In this way, we can check both *-delims and *-braces by `LaTeX-current-verbatim-macro' in `LaTeX-verbatim-p' without `TeX-current-macro' like this: ---------------------------------------------------------------------- (defun LaTeX-verbatim-p (&optional pos) [...] (or (progn (syntax-propertize (point)) (nth 3 (syntax-ppss))) (LaTeX-current-verbatim-macro) (member (LaTeX-current-environment) (LaTeX-verbatim-environments))))) ---------------------------------------------------------------------- Actually, we can even omit `LaTeX-current-verbatim-macro' itself and use `LaTeX-verbatim-macro-boundaries' instead: ---------------------------------------------------------------------- (defun LaTeX-verbatim-p (&optional pos) [...] (or (progn (syntax-propertize (point)) (nth 3 (syntax-ppss))) (LaTeX-verbatim-macro-boundaries) (member (LaTeX-current-environment) (LaTeX-verbatim-environments))))) ---------------------------------------------------------------------- (4) Actually, we usually need only (progn (syntax-propertize (point)) (nth 3 (syntax-ppss))) part in `LaTeX-verbatim-p' after all; the rest is fallback code for the case that syntax propertize in font-latex.el wasn't used. (Unlike `LaTeX-verbatim-macro-boundaries', `(nth 3 (syntax-ppss))' doesn't return true on "\verb" macro itself; however it doesn't matter from what I wrote in (2).) Summing up the considerations above, I arrvied at the attached tentative fix. I confirmed that it passes the regression tests. What do you think about it? (By the way, as written in the comment of the patch, I don't understand the reason why the while loop in `LaTeX-verbatim-macro-boundaries' goes back to the previous line. Is there any \verb variant, say in fancyverb or fvextra, which allows newline in its argument?) Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=patch Content-Description: my proposal diff --git a/latex.el b/latex.el index fb862b76..3b681b1f 100644 --- a/latex.el +++ b/latex.el @@ -3785,20 +3785,23 @@ values of the variable `LaTeX-verbatim-environments' as well.") Boundaries are returned as a cons cell where the car is the macro start and the cdr the macro end. -Only macros which enclose their arguments with special -non-parenthetical delimiters, like \\verb+foo+, are recognized." +It doesn't regard the point just before \\verb... etc. belongs to +the verbatim macro. This isn't symmetric with +`TeX-find-macro-boundaries'." (save-excursion (let ((orig (point)) - (verbatim-regexp (regexp-opt (LaTeX-verbatim-macros-with-delims) t))) - ;; Search backwards for the macro start, unless we are facing one - (unless (looking-at (concat (regexp-quote TeX-esc) verbatim-regexp)) - (catch 'found - (while (progn - (skip-chars-backward (concat "^\n" (regexp-quote TeX-esc)) - (line-beginning-position)) - (when (looking-at verbatim-regexp) (throw 'found nil)) - (or (bobp) (forward-char -1)) - (/= (point) (line-beginning-position)))))) + (verbatim-regexp (regexp-opt + (append (LaTeX-verbatim-macros-with-delims) + (LaTeX-verbatim-macros-with-braces)) + t))) + (catch 'found + (while (progn + (skip-chars-backward (concat "^" (regexp-quote TeX-esc)) + (line-beginning-position)) + (when (looking-at verbatim-regexp) (throw 'found nil)) + ;; XXX: Why do we go back to the preceding lines? + (or (bobp) (forward-char -1)) + (not (bolp))))) ;; Search forward for the macro end, unless we failed to find a start (unless (bolp) (let* ((beg (1- (point))) @@ -3820,27 +3823,27 @@ non-parenthetical delimiters, like \\verb+foo+, are recognized." (when (<= orig (point)) (cons beg (1+ (point))))))))) -(defun LaTeX-current-verbatim-macro () - "Return name of verbatim macro containing point, nil if none is present." - (let ((macro-boundaries (LaTeX-verbatim-macro-boundaries))) - (when macro-boundaries - (save-excursion - (goto-char (car macro-boundaries)) - (forward-char (length TeX-esc)) - (buffer-substring-no-properties - (point) (progn (skip-chars-forward "@A-Za-z*") (point))))))) +;; (defun LaTeX-current-verbatim-macro () +;; "Return name of verbatim macro containing point, nil if none is present." +;; (let ((macro-boundaries (LaTeX-verbatim-macro-boundaries))) +;; (when macro-boundaries +;; (save-excursion +;; (goto-char (car macro-boundaries)) +;; (forward-char (length TeX-esc)) +;; (buffer-substring-no-properties +;; (point) (progn (skip-chars-forward "@A-Za-z*") (point))))))) (defun LaTeX-verbatim-p (&optional pos) "Return non-nil if position POS is in a verbatim-like construct." (when pos (goto-char pos)) (save-match-data - (or (progn + (if (eq TeX-install-font-lock 'font-latex-setup) + (progn (syntax-propertize (point)) (nth 3 (syntax-ppss))) - (member (LaTeX-current-verbatim-macro) - (LaTeX-verbatim-macros-with-delims)) - (member (TeX-current-macro) (LaTeX-verbatim-macros-with-braces)) - (member (LaTeX-current-environment) (LaTeX-verbatim-environments))))) + (or + (LaTeX-verbatim-macro-boundaries) + (member (LaTeX-current-environment) (LaTeX-verbatim-environments)))))) ;;; Formatting --=-=-=-- From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Ikumi Keita Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Mon, 13 Feb 2023 05:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: 61400@debbugs.gnu.org Cc: Arash Esbati , Tassilo Horn Received: via spool by 61400-submit@debbugs.gnu.org id=B61400.16762664859219 (code B ref 61400); Mon, 13 Feb 2023 05:35:02 +0000 Received: (at 61400) by debbugs.gnu.org; 13 Feb 2023 05:34:45 +0000 Received: from localhost ([127.0.0.1]:47378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRRUC-0002Od-UV for submit@debbugs.gnu.org; Mon, 13 Feb 2023 00:34:45 -0500 Received: from smtp1a.inetd.co.jp ([210.129.88.11]:56636) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRRUA-0002OR-8c for 61400@debbugs.gnu.org; Mon, 13 Feb 2023 00:34:43 -0500 Received: from localhost (42-144-46-173.rev.home.ne.jp [42.144.46.173]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id C94635C; Mon, 13 Feb 2023 14:34:39 +0900 (JST) From: Ikumi Keita In-reply-to: <87312.1676215926@localhost> References: <86lel56gxq.fsf@gnu.org> <87edqx7tyw.fsf@gnu.org> <86h6vt6edv.fsf@gnu.org> <87a61l7rsm.fsf@gnu.org> <86sffdvjc7.fsf@gnu.org> <77898.1676105752@localhost> <86o7pzku7s.fsf@gnu.org> <87312.1676215926@localhost> Comments: In-reply-to Ikumi Keita message dated "Mon, 13 Feb 2023 00:32:06 +0900." X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 28.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <91243.1676266478.1@localhost> Date: Mon, 13 Feb 2023 14:34:39 +0900 Message-ID: <91244.1676266479@localhost> 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 (-) Following up myself. >>>>> Ikumi Keita writes: > (2) `LaTeX-verbatim-p' is currently used only in > `fill-nobreak-predicate', `LaTeX-search-forward-comment-start' and > `TeX-in-comment' (through `TeX-verbatim-p-function'): Sorry, there is another instance of usage in `TeX-insert-dollar'. That is safe for the proposed change for `LaTeX-verbatim-p', too. > (By the way, as written in the comment of the patch, I don't understand > the reason why the while loop in `LaTeX-verbatim-macro-boundaries' goes > back to the previous line. Is there any \verb variant, say in fancyverb > or fvextra, which allows newline in its argument?) I misunderstood the role of `(forward-char -1)'. (^_^;) It passes over the backslash. Going back to the previous line is just an unintentional side effect, `(bobp)' in front of `(forward-char -1)' should actually be `(bolp)'. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Arash Esbati Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Mon, 13 Feb 2023 11:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Ikumi Keita Cc: 61400@debbugs.gnu.org, Tassilo Horn Received: via spool by 61400-submit@debbugs.gnu.org id=B61400.167628651813639 (code B ref 61400); Mon, 13 Feb 2023 11:09:01 +0000 Received: (at 61400) by debbugs.gnu.org; 13 Feb 2023 11:08:38 +0000 Received: from localhost ([127.0.0.1]:47778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRWhJ-0003Xu-E6 for submit@debbugs.gnu.org; Mon, 13 Feb 2023 06:08:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36330) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRWhH-0003Xi-BV for 61400@debbugs.gnu.org; Mon, 13 Feb 2023 06:08:35 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRWhA-0005om-2p; Mon, 13 Feb 2023 06:08:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=C09g7x3RtoEjZyTBi1Qnb+zQ9lutgwn0klvXkZe2TZ0=; b=bpsf0WsVDWiJ7lw3v/UL ebRtUaRBQ2xCr89qZTOXMn5O7NjwLX2NDFVTcjqwaq0rHt4Z39U80iHkOitDAfpyXXyz4iaFw1h2V ORk54KCAkmP3tFYO1XAFR/ITd6/yv0KryZvKfboGMOVWvjirjGh04OqKwECr+MGYbVByBECLKXLyP Swi4YwVTkzxCrAmqAnlrPa/tQGToxhEvZnOIJBRNuvckJRi2rvc8KEgMJmNPrdIjPhX0bixu21hkB FQXeumIgTkoBR8z+gZifO7labakSF3nhsNezDv7TEd48NjiXJ49pfnMrAswyJU9BbJXaivtW2gD0D bgxh6GyyHEULZQ==; Received: from p5b326467.dip0.t-ipconnect.de ([91.50.100.103] helo=MUTANT) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRWh9-0003vp-HB; Mon, 13 Feb 2023 06:08:27 -0500 From: Arash Esbati In-Reply-To: <87312.1676215926@localhost> (Ikumi Keita's message of "Mon, 13 Feb 2023 00:32:06 +0900") References: <86lel56gxq.fsf@gnu.org> <87edqx7tyw.fsf@gnu.org> <86h6vt6edv.fsf@gnu.org> <87a61l7rsm.fsf@gnu.org> <86sffdvjc7.fsf@gnu.org> <77898.1676105752@localhost> <86o7pzku7s.fsf@gnu.org> <87312.1676215926@localhost> Date: Mon, 13 Feb 2023 12:07:59 +0100 Message-ID: <86fsb97rhs.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) 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 (---) Ikumi Keita writes: > Looking at the current code closely, I think we can take a more drastic > route. :-) That's always highly welcome :-) > Thus it's safe to modify `LaTeX-verbatim-p' to return nil at just before > "\verb|...|" etc. by the following reasons: > o In `LaTeX-search-forward-comment-start', `LaTeX-verbatim-p' is always > called just before % sign. > o In `TeX-in-comment', `LaTeX-verbatim-p' is always called in a comment. Do we really want this? My gut feeling is to have `LaTeX-verbatim-p' returns t just before the "\verb|...|" etc., i.e., when cursor is over the backslash. > (3) I began to feel unsatisfied that `LaTeX-verbatim-p' needs the check > for `LaTeX-verbatim-macros-with-braces' in addition to > `LaTeX-current-verbatim-macro': > ---------------------------------------------------------------------- > (defun LaTeX-verbatim-p (&optional pos) > [...] > (member (LaTeX-current-verbatim-macro) > (LaTeX-verbatim-macros-with-delims)) > (member (TeX-current-macro) (LaTeX-verbatim-macros-with-braces)) <--- Here > (member (LaTeX-current-environment) (LaTeX-verbatim-environments))))) > ---------------------------------------------------------------------- > Why can't `LaTeX-current-verbatim-macro' check both *-delims and > *-braces at the same time? Its name suggests it _should_ be able to > handle either type. This was also my takeaway after reading the code. > In addition, we don't have to keep the symmetric behavior of > `LaTeX-current-verbatim-macro' and `TeX-current-macro', given what I > wrote in (1). So we can modify `LaTeX-verbatim-macro-boundaries' so that > it returns nil at just before "\verb..." etc. See above, my thinking is if it will be more future proof the other way around. > Summing up the considerations above, I arrvied at the attached > tentative fix. I confirmed that it passes the regression tests. > > What do you think about it? Thanks, LGTM. One other complication we have to deal with is that \Verb from fancyvrb or \lstinline from listings can have an optional argument, e.g.: \Verb[fontsize=\scriptsize]|foo bar| The following change to your suggestion should work: --8<---------------cut here---------------start------------->8--- (defun LaTeX-verbatim-macro-boundaries () "Return boundaries of verbatim macro. Boundaries are returned as a cons cell where the car is the macro start and the cdr the macro end. It doesn't regard the point just before \\verb... etc. belongs to the verbatim macro. This isn't symmetric with `TeX-find-macro-boundaries'." (save-excursion (let ((orig (point)) (verbatim-regexp (regexp-opt (append (LaTeX-verbatim-macros-with-delims) (LaTeX-verbatim-macros-with-braces)) t))) (catch 'found (while (progn (skip-chars-backward (concat "^" (regexp-quote TeX-esc)) (line-beginning-position)) (when (looking-at verbatim-regexp) (throw 'found nil)) ;; XXX: Why do we go back to the preceding lines? (or (bobp) (forward-char -1)) (not (bolp))))) ;; Search forward for the macro end, unless we failed to find a start (unless (bolp) (let* ((beg (1- (point))) (macro-end (match-end 0)) ;; -- NEW opt-end ;; -- CHANGED ;; XXX: Here we assume we are dealing with \verb which ;; expects the delimiter right behind the command. ;; However, \lstinline can also cope with whitespace as ;; well as an optional argument after the command. ;; Besides, \lstinline or \Verb (from fancyvrb) also ;; accept an optional argument which we have to ;; encounter. We assume that users don't write ;; something like this '\Verb[foo[' and again the ;; delimiter is directly after the ] closing the ;; optional argument: ;; -- CHANGED (delimiter (if (= (char-after macro-end) ?\[) (save-excursion (goto-char macro-end) (forward-list) (setq opt-end (point)) (string (following-char))) (buffer-substring-no-properties macro-end (1+ macro-end))))) ;; Heuristic: If an opening brace is encountered, search for ;; both the opening and the closing brace as an end marker. ;; Like that the function should work for \verb|...| as well ;; as for \url{...}. (when (string= delimiter TeX-grop) (setq delimiter (concat delimiter TeX-grcl))) ;; -- CHANGED (if opt-end (goto-char (1+ opt-end)) (goto-char (1+ macro-end))) (skip-chars-forward (concat "^" delimiter)) (when (<= orig (point)) (cons beg (1+ (point))))))))) --8<---------------cut here---------------end--------------->8--- And while we're at it: The docstring isn't correct any more, right? I mean this part: It doesn't regard the point just before \\verb... etc. belongs to the verbatim macro. This isn't symmetric with `TeX-find-macro-boundaries'. > (By the way, as written in the comment of the patch, I don't understand > the reason why the while loop in `LaTeX-verbatim-macro-boundaries' goes > back to the previous line. Is there any \verb variant, say in fancyverb > or fvextra, which allows newline in its argument?) No, not that I'm aware of; linebreak in verb arg is a no-no. > +;; (defun LaTeX-current-verbatim-macro () > +;; "Return name of verbatim macro containing point, nil if none is present." > +;; (let ((macro-boundaries (LaTeX-verbatim-macro-boundaries))) > +;; (when macro-boundaries > +;; (save-excursion > +;; (goto-char (car macro-boundaries)) > +;; (forward-char (length TeX-esc)) > +;; (buffer-substring-no-properties > +;; (point) (progn (skip-chars-forward "@A-Za-z*") (point))))))) Would it make sense to keep the above as a utility function? Best, Arash From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Ikumi Keita Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Tue, 14 Feb 2023 06:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Arash Esbati Cc: 61400@debbugs.gnu.org, Tassilo Horn Received: via spool by 61400-submit@debbugs.gnu.org id=B61400.167635722314564 (code B ref 61400); Tue, 14 Feb 2023 06:48:01 +0000 Received: (at 61400) by debbugs.gnu.org; 14 Feb 2023 06:47:03 +0000 Received: from localhost ([127.0.0.1]:52337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRp5i-0003mg-Ot for submit@debbugs.gnu.org; Tue, 14 Feb 2023 01:47:03 -0500 Received: from smtp1a.inetd.co.jp ([210.129.88.11]:59584) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRp5d-0003mA-2e for 61400@debbugs.gnu.org; Tue, 14 Feb 2023 01:47:01 -0500 Received: from localhost (42-144-46-173.rev.home.ne.jp [42.144.46.173]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id CCED960; Tue, 14 Feb 2023 15:46:54 +0900 (JST) From: Ikumi Keita In-reply-to: <86fsb97rhs.fsf@gnu.org> References: <86lel56gxq.fsf@gnu.org> <87edqx7tyw.fsf@gnu.org> <86h6vt6edv.fsf@gnu.org> <87a61l7rsm.fsf@gnu.org> <86sffdvjc7.fsf@gnu.org> <77898.1676105752@localhost> <86o7pzku7s.fsf@gnu.org> <87312.1676215926@localhost> <86fsb97rhs.fsf@gnu.org> Comments: In-reply-to Arash Esbati message dated "Mon, 13 Feb 2023 12:07:59 +0100." X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 28.2 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Date: Tue, 14 Feb 2023 15:46:53 +0900 Message-ID: <1773.1676357213@localhost> 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 (-) --=-=-= Content-Type: text/plain Hi Arash, >>>>> Arash Esbati writes: > Do we really want this? My gut feeling is to have `LaTeX-verbatim-p' > returns t just before the "\verb|...|" etc., i.e., when cursor is over > the backslash. OK, then another candidate is the attached patch. This keeps the current behavior of `LaTeX-verbatim-p' and introduces a new function `LaTeX-verbatim-nobreak-p' as you suggested in your previous message. However, I'm a bit reluctant. 1. If `LaTeX-verbatim-p' should return non-nil at just before "\verb", then it should also do so just before "\begin{verbatim}" for consistency, shouldn't it? 2. Suppose that you type "$" just before "\verb...". Then `TeX-insert-dollar' inserts only one "$" instead of "$$" under the current behavior of `LaTeX-verbatim-p', because `TeX-insert-dollar' uses `TeX-verbatim-p'. I think it's unexpected. > Thanks, LGTM. One other complication we have to deal with is that \Verb > from fancyvrb or \lstinline from listings can have an optional argument, > e.g.: > \Verb[fontsize=\scriptsize]|foo bar| Thanks, I incorporated it with slight modification in the attached patch. >> +;; (defun LaTeX-current-verbatim-macro () >> +;; "Return name of verbatim macro containing point, nil if none is present." >> +;; (let ((macro-boundaries (LaTeX-verbatim-macro-boundaries))) >> +;; (when macro-boundaries >> +;; (save-excursion >> +;; (goto-char (car macro-boundaries)) >> +;; (forward-char (length TeX-esc)) >> +;; (buffer-substring-no-properties >> +;; (point) (progn (skip-chars-forward "@A-Za-z*") (point))))))) > Would it make sense to keep the above as a utility function? This time I leave that function as is. > And while we're at it: The docstring isn't correct any more, right? I > mean this part: > It doesn't regard the point just before \\verb... etc. belongs to > the verbatim macro. This isn't symmetric with > `TeX-find-macro-boundaries'. In my previous patch, it's correct because I removed the chunk (if (looking-at (concat (regexp-quote TeX-esc) verbatim-regexp)) (forward-char 1) from `LaTeX-verbatim-macro-boundaries'. :-) (By the way, I noticed that `LaTeX-verbatim-p' raises error when "\verb" is at the end of the buffer without delimiters and its contents "|...|". In fact `LaTeX-verbatim-macro-boundaries' and `LaTeX-current-verbatim-macro' raise the same error. The reason is that `LaTeX-verbatim-macro-boundaries' presumes there is nonempty string after the macro body. Should we cater for such corner case?) Best, Ikumi Keita #StandWithUkraine #StopWarInUkraine --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=patch Content-Description: keep current LaTeX-verbatim-p diff --git a/latex.el b/latex.el index fb862b76..93c13dd8 100644 --- a/latex.el +++ b/latex.el @@ -3780,45 +3780,66 @@ values of the variable `LaTeX-verbatim-environments' as well.") (append LaTeX-verbatim-environments LaTeX-verbatim-environments-local)) -(defun LaTeX-verbatim-macro-boundaries () - "Return boundaries of verbatim macro. +(defun LaTeX-verbatim-macro-boundaries (&optional arg-only) + "Return boundaries of verbatim macro containing point. Boundaries are returned as a cons cell where the car is the macro start and the cdr the macro end. -Only macros which enclose their arguments with special -non-parenthetical delimiters, like \\verb+foo+, are recognized." +If optional argument ARG-ONLY is non-nil, return the inner region +of the macro argument as cons." (save-excursion (let ((orig (point)) - (verbatim-regexp (regexp-opt (LaTeX-verbatim-macros-with-delims) t))) + (verbatim-regexp (regexp-opt + (append (LaTeX-verbatim-macros-with-delims) + (LaTeX-verbatim-macros-with-braces)) + t))) ;; Search backwards for the macro start, unless we are facing one - (unless (looking-at (concat (regexp-quote TeX-esc) verbatim-regexp)) - (catch 'found - (while (progn - (skip-chars-backward (concat "^\n" (regexp-quote TeX-esc)) - (line-beginning-position)) - (when (looking-at verbatim-regexp) (throw 'found nil)) - (or (bobp) (forward-char -1)) - (/= (point) (line-beginning-position)))))) + (if (looking-at (concat (regexp-quote TeX-esc) verbatim-regexp)) + (forward-char 1) + (while (progn + (skip-chars-backward (concat "^" (regexp-quote TeX-esc)) + (line-beginning-position)) + (if (or (bolp) + (looking-at verbatim-regexp)) + ;; Terminate the loop. + nil + (forward-char -1) + ;; Continue the loop. + t)))) ;; Search forward for the macro end, unless we failed to find a start (unless (bolp) (let* ((beg (1- (point))) - (macro-end (match-end 0)) + (end (match-end 0)) ;; XXX: Here we assume we are dealing with \verb which ;; expects the delimiter right behind the command. ;; However, \lstinline can also cope with whitespace as ;; well as an optional argument after the command. - (delimiter (buffer-substring-no-properties - macro-end (1+ macro-end)))) + ;; Besides, \lstinline or \Verb (from fancyvrb) also + ;; accept an optional argument which we have to + ;; encounter. We assume that users don't write + ;; something like this '\Verb[foo[' and again the + ;; delimiter is directly after the ] closing the + ;; optional argument: + (delimiter (if (= (char-after end) ?\[) + ;; Update `end'. + (save-excursion (goto-char end) + (forward-list) + (setq end (point)) + (string (following-char))) + (buffer-substring-no-properties + end (1+ end)))) ;; Heuristic: If an opening brace is encountered, search for ;; both the opening and the closing brace as an end marker. ;; Like that the function should work for \verb|...| as well ;; as for \url{...}. (when (string= delimiter TeX-grop) (setq delimiter (concat delimiter TeX-grcl))) - (goto-char (1+ macro-end)) + (goto-char (1+ end)) (skip-chars-forward (concat "^" delimiter)) (when (<= orig (point)) - (cons beg (1+ (point))))))))) + (if arg-only + (cons (1+ end) (point)) + (cons beg (1+ (point))))))))))) (defun LaTeX-current-verbatim-macro () "Return name of verbatim macro containing point, nil if none is present." @@ -3832,16 +3853,34 @@ non-parenthetical delimiters, like \\verb+foo+, are recognized." (defun LaTeX-verbatim-p (&optional pos) "Return non-nil if position POS is in a verbatim-like construct." + ;; This returns non-nil when POS is at just before "\verb...". (when pos (goto-char pos)) (save-match-data (or (progn (syntax-propertize (point)) (nth 3 (syntax-ppss))) - (member (LaTeX-current-verbatim-macro) - (LaTeX-verbatim-macros-with-delims)) - (member (TeX-current-macro) (LaTeX-verbatim-macros-with-braces)) + (LaTeX-verbatim-macro-boundaries) (member (LaTeX-current-environment) (LaTeX-verbatim-environments))))) +(defun LaTeX-verbatim-nobreak-p () + "Return non-nil if current position is in a verbatim-like construct. +The macro body (\"\\verb\") and its delimiters, including optional +argument if any, aren't considered as component of a verbatim-like construct." + ;; Intended for `fill-nobreak-predicate'. + + ;; TODO: Factor out syntax propertize facility from font-latex.el + ;; and re-implement as major mode feature. + (if (eq TeX-install-font-lock 'font-latex-setup) + (progn + (syntax-propertize (point)) + (nth 3 (syntax-ppss))) + ;; Fallback for users who stay away from font-latex. + (or + (let (region (LaTeX-verbatim-macro-boundaries t)) + (and region + (<= (car region) (point) (cdr region)))) + (member (LaTeX-current-environment) (LaTeX-verbatim-environments))))) + ;;; Formatting @@ -7960,7 +7999,7 @@ function would return non-nil and `(match-string 1)' would return ;; Cater for \verb|...| (and similar) contructs which should not be ;; broken. (add-to-list (make-local-variable 'fill-nobreak-predicate) - #'LaTeX-verbatim-p t) + #'LaTeX-verbatim-nobreak-p t) (or LaTeX-largest-level (setq LaTeX-largest-level (LaTeX-section-level "section"))) --=-=-=-- From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Arash Esbati Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Tue, 14 Feb 2023 10:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Ikumi Keita Cc: 61400@debbugs.gnu.org, Tassilo Horn Received: via spool by 61400-submit@debbugs.gnu.org id=B61400.16763706815873 (code B ref 61400); Tue, 14 Feb 2023 10:32:02 +0000 Received: (at 61400) by debbugs.gnu.org; 14 Feb 2023 10:31:21 +0000 Received: from localhost ([127.0.0.1]:52648 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRsan-0001We-1D for submit@debbugs.gnu.org; Tue, 14 Feb 2023 05:31:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41866) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRsal-0001WR-Vu for 61400@debbugs.gnu.org; Tue, 14 Feb 2023 05:31:20 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRsae-0005bJ-Vq; Tue, 14 Feb 2023 05:31:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=PFrFfkP4dLJF4+cCebOp3d4zoeSlnj+t1UjQAK9KJGA=; b=U4QrdKlwMFGm3KQhyG1q BZg8Fbf0JR040pqvwnohGPLTB3+Z4pk5gpMGD2+XgOYQE+Jg58uUsbyj2DQzJUpjhDJhhys9Xj4w5 OCCkypXIETkVPW0Z2pL13UPEzH3haAUWTVBCo7oXZZhuHCTvWrLWbLdZlDpOZrI5E2AimnQg30MT8 NfbqI29H7OknxIBTjv888k70kj4Trd56kyUXah8zNqRJkppt9khs9RNYoqgFk8G21Gu5woAApA4+8 4cHqPOcqKXr91nOHcaK62JbJzXl/Pxx1PrPC5wCsXMUp+LqoAeTRR4irFwh3Sh8lpmZekKz/KLFJB Ar64unXVENeCvQ==; Received: from p5b326467.dip0.t-ipconnect.de ([91.50.100.103] helo=MUTANT) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRsae-00051w-Ej; Tue, 14 Feb 2023 05:31:12 -0500 From: Arash Esbati In-Reply-To: <1773.1676357213@localhost> (Ikumi Keita's message of "Tue, 14 Feb 2023 15:46:53 +0900") References: <86lel56gxq.fsf@gnu.org> <87edqx7tyw.fsf@gnu.org> <86h6vt6edv.fsf@gnu.org> <87a61l7rsm.fsf@gnu.org> <86sffdvjc7.fsf@gnu.org> <77898.1676105752@localhost> <86o7pzku7s.fsf@gnu.org> <87312.1676215926@localhost> <86fsb97rhs.fsf@gnu.org> <1773.1676357213@localhost> Date: Tue, 14 Feb 2023 11:30:13 +0100 Message-ID: <865yc4wnd6.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) 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 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Keita, Ikumi Keita writes: > OK, then another candidate is the attached patch. Thanks. > This keeps the current behavior of `LaTeX-verbatim-p' and introduces a > new function `LaTeX-verbatim-nobreak-p' as you suggested in your > previous message. > > However, I'm a bit reluctant. > 1. If `LaTeX-verbatim-p' should return non-nil at just before > "\verb", then it should also do so just before "\begin{verbatim}" for > consistency, shouldn't it? > 2. Suppose that you type "$" just before "\verb...". Then > `TeX-insert-dollar' inserts only one "$" instead of "$$" under the > current behavior of `LaTeX-verbatim-p', because `TeX-insert-dollar' > uses `TeX-verbatim-p'. I think it's unexpected.=20 I think we have everything we need now so we can change the behavior of `LaTeX-verbatim-p' acc. to what you describe above because: =E2=80=A2 `LaTeX-verbatim-macro-boundaries' returns the inner (nice!) and = outer boundries of a macro, incl. the backslash =E2=80=A2 `LaTeX-current-verbatim-macro' returns the name of the macro So one can extract all the information needed. > Thanks, I incorporated it with slight modification in the attached > patch. =F0=9F=99=8F > In my previous patch, it's correct because I removed the chunk > (if (looking-at (concat (regexp-quote TeX-esc) verbatim-regexp)) > (forward-char 1) > from `LaTeX-verbatim-macro-boundaries'. :-) Ok. Note that I had to apply the patch attached on top of yours in order to get it working (some trouble with parens). I've also adjusted the comment (the optional arg of \lstinline was already there). And also I changed (delimiter (if (=3D (char-after end) ?\[) to (delimiter (if (string=3D (string (char-after end)) LaTeX-optop) in case that character changes. > (By the way, I noticed that `LaTeX-verbatim-p' raises error when "\verb" > is at the end of the buffer without delimiters and its contents "|...|". > In fact `LaTeX-verbatim-macro-boundaries' and > `LaTeX-current-verbatim-macro' raise the same error. The reason is that > `LaTeX-verbatim-macro-boundaries' presumes there is nonempty string > after the macro body. Should we cater for such corner case?) I'd say let's fix the issue at hand and then see if others complain and there is a real use for this corner case, and then we can touch that. Does it make sense? Best, Arash --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=patchpatch Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xhdGV4LmVsIGIvbGF0ZXguZWwKaW5kZXggOTNjMTNkZDguLmIzZTNkM2U1 IDEwMDY0NAotLS0gYS9sYXRleC5lbAorKysgYi9sYXRleC5lbApAQCAtMzgxNCwyMCArMzgxNCwx OSBAQCBvZiB0aGUgbWFjcm8gYXJndW1lbnQgYXMgY29ucy4iCiAgICAgICAgICAgICAgICA7OyBl eHBlY3RzIHRoZSBkZWxpbWl0ZXIgcmlnaHQgYmVoaW5kIHRoZSBjb21tYW5kLgogICAgICAgICAg ICAgICAgOzsgSG93ZXZlciwgXGxzdGlubGluZSBjYW4gYWxzbyBjb3BlIHdpdGggd2hpdGVzcGFj ZSBhcwogICAgICAgICAgICAgICAgOzsgd2VsbCBhcyBhbiBvcHRpb25hbCBhcmd1bWVudCBhZnRl ciB0aGUgY29tbWFuZC4KLSAgICAgICAgICAgICAgIDs7IEJlc2lkZXMsIFxsc3RpbmxpbmUgb3Ig XFZlcmIgKGZyb20gZmFuY3l2cmIpIGFsc28KLSAgICAgICAgICAgICAgIDs7IGFjY2VwdCBhbiBv cHRpb25hbCBhcmd1bWVudCB3aGljaCB3ZSBoYXZlIHRvCi0gICAgICAgICAgICAgICA7OyBlbmNv dW50ZXIuICBXZSBhc3N1bWUgdGhhdCB1c2VycyBkb24ndCB3cml0ZQotICAgICAgICAgICAgICAg Ozsgc29tZXRoaW5nIGxpa2UgdGhpcyAnXFZlcmJbZm9vWycgYW5kIGFnYWluIHRoZQotICAgICAg ICAgICAgICAgOzsgZGVsaW1pdGVyIGlzIGRpcmVjdGx5IGFmdGVyIHRoZSBdIGNsb3NpbmcgdGhl Ci0gICAgICAgICAgICAgICA7OyBvcHRpb25hbCBhcmd1bWVudDoKLSAgICAgICAgICAgICAgIChk ZWxpbWl0ZXIgKGlmICg9IChjaGFyLWFmdGVyIGVuZCkgP1xbKQorICAgICAgICAgICAgICAgOzsg XFZlcmIgKGZyb20gZmFuY3l2cmIpIGFsc28gYWNjZXB0cyBhbiBvcHRpb25hbAorICAgICAgICAg ICAgICAgOzsgYXJndW1lbnQgd2hpY2ggd2UgaGF2ZSB0byBlbmNvdW50ZXIuICBXZSBhc3N1bWUg dGhhdAorICAgICAgICAgICAgICAgOzsgdXNlcnMgZG9uJ3Qgd3JpdGUgc29tZXRoaW5nIGxpa2Ug dGhpcyAnXFZlcmJbZm9vWycKKyAgICAgICAgICAgICAgIDs7IGFuZCBhZ2FpbiB0aGUgZGVsaW1p dGVyIGlzIGRpcmVjdGx5IGFmdGVyIHRoZSBdCisgICAgICAgICAgICAgICA7OyBjbG9zaW5nIHRo ZSBvcHRpb25hbCBhcmd1bWVudDoKKyAgICAgICAgICAgICAgIChkZWxpbWl0ZXIgKGlmIChzdHJp bmc9IChzdHJpbmcgKGNoYXItYWZ0ZXIgZW5kKSkgTGFUZVgtb3B0b3ApCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA7OyBVcGRhdGUgYGVuZCcuCiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoc2F2ZS1leGN1cnNpb24gKGdvdG8tY2hhciBlbmQpCiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGZvcndhcmQtbGlzdCkKICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc2V0cSBlbmQgKHBvaW50KSkKICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc3RyaW5nIChmb2xs b3dpbmctY2hhcikpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIChidWZmZXItc3Vic3Ry aW5nLW5vLXByb3BlcnRpZXMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5kICgxKyBl bmQpKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuZCAoMSsgZW5kKSkpKSkKICAg ICAgICAgICA7OyBIZXVyaXN0aWM6IElmIGFuIG9wZW5pbmcgYnJhY2UgaXMgZW5jb3VudGVyZWQs IHNlYXJjaCBmb3IKICAgICAgICAgICA7OyBib3RoIHRoZSBvcGVuaW5nIGFuZCB0aGUgY2xvc2lu ZyBicmFjZSBhcyBhbiBlbmQgbWFya2VyLgogICAgICAgICAgIDs7IExpa2UgdGhhdCB0aGUgZnVu Y3Rpb24gc2hvdWxkIHdvcmsgZm9yIFx2ZXJifC4uLnwgYXMgd2VsbApAQCAtMzgzOSw3ICszODM4 LDcgQEAgb2YgdGhlIG1hY3JvIGFyZ3VtZW50IGFzIGNvbnMuIgogICAgICAgICAgICh3aGVuICg8 PSBvcmlnIChwb2ludCkpCiAgICAgICAgICAgICAoaWYgYXJnLW9ubHkKICAgICAgICAgICAgICAg ICAoY29ucyAoMSsgZW5kKSAocG9pbnQpKQotICAgICAgICAgICAgICAoY29ucyBiZWcgKDErIChw b2ludCkpKSkpKSkpKSkpCisgICAgICAgICAgICAgIChjb25zIGJlZyAoMSsgKHBvaW50KSkpKSkp KSkpKQogCiAoZGVmdW4gTGFUZVgtY3VycmVudC12ZXJiYXRpbS1tYWNybyAoKQogICAiUmV0dXJu IG5hbWUgb2YgdmVyYmF0aW0gbWFjcm8gY29udGFpbmluZyBwb2ludCwgbmlsIGlmIG5vbmUgaXMg cHJlc2VudC4iCkBAIC0zODc2LDcgKzM4NzUsNyBAQCBhcmd1bWVudCBpZiBhbnksIGFyZW4ndCBj b25zaWRlcmVkIGFzIGNvbXBvbmVudCBvZiBhIHZlcmJhdGltLWxpa2UgY29uc3RydWN0LiIKICAg ICAgICAgKG50aCAzIChzeW50YXgtcHBzcykpKQogICAgIDs7IEZhbGxiYWNrIGZvciB1c2VycyB3 aG8gc3RheSBhd2F5IGZyb20gZm9udC1sYXRleC4KICAgICAob3IKLSAgICAgKGxldCAocmVnaW9u IChMYVRlWC12ZXJiYXRpbS1tYWNyby1ib3VuZGFyaWVzIHQpKQorICAgICAobGV0ICgocmVnaW9u IChMYVRlWC12ZXJiYXRpbS1tYWNyby1ib3VuZGFyaWVzIHQpKSkKICAgICAgICAoYW5kIHJlZ2lv bgogICAgICAgICAgICAgKDw9IChjYXIgcmVnaW9uKSAocG9pbnQpIChjZHIgcmVnaW9uKSkpKQog ICAgICAobWVtYmVyIChMYVRlWC1jdXJyZW50LWVudmlyb25tZW50KSAoTGFUZVgtdmVyYmF0aW0t ZW52aXJvbm1lbnRzKSkpKSkK --=-=-=-- From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Ikumi Keita Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Wed, 15 Feb 2023 06:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Arash Esbati Cc: 61400@debbugs.gnu.org, Tassilo Horn Received: via spool by 61400-submit@debbugs.gnu.org id=B61400.16764426603098 (code B ref 61400); Wed, 15 Feb 2023 06:31:01 +0000 Received: (at 61400) by debbugs.gnu.org; 15 Feb 2023 06:31:00 +0000 Received: from localhost ([127.0.0.1]:57616 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSBJk-0000nt-2L for submit@debbugs.gnu.org; Wed, 15 Feb 2023 01:31:00 -0500 Received: from smtp1a.inetd.co.jp ([210.129.88.11]:34016) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSBJh-0000nj-UW for 61400@debbugs.gnu.org; Wed, 15 Feb 2023 01:30:58 -0500 Received: from localhost (42-144-46-173.rev.home.ne.jp [42.144.46.173]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id 99E9674; Wed, 15 Feb 2023 15:30:55 +0900 (JST) From: Ikumi Keita In-reply-to: <865yc4wnd6.fsf@gnu.org> References: <86lel56gxq.fsf@gnu.org> <87edqx7tyw.fsf@gnu.org> <86h6vt6edv.fsf@gnu.org> <87a61l7rsm.fsf@gnu.org> <86sffdvjc7.fsf@gnu.org> <77898.1676105752@localhost> <86o7pzku7s.fsf@gnu.org> <87312.1676215926@localhost> <86fsb97rhs.fsf@gnu.org> <1773.1676357213@localhost> <865yc4wnd6.fsf@gnu.org> Comments: In-reply-to Arash Esbati message dated "Tue, 14 Feb 2023 11:30:13 +0100." X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 28.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 15 Feb 2023 15:30:52 +0900 Message-ID: <8749.1676442652@localhost> 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 (-) Hi Arash, >>>>> Arash Esbati writes: >> However, I'm a bit reluctant. >> 1. If `LaTeX-verbatim-p' should return non-nil at just before >> "\verb", then it should also do so just before "\begin{verbatim}" for >> consistency, shouldn't it? >> 2. Suppose that you type "$" just before "\verb...". Then >> `TeX-insert-dollar' inserts only one "$" instead of "$$" under the >> current behavior of `LaTeX-verbatim-p', because `TeX-insert-dollar' >> uses `TeX-verbatim-p'. I think it's unexpected.=20 > > I think we have everything we need now so we can change the behavior of > `LaTeX-verbatim-p' acc. to what you describe above because: Sorry, I'm unsure what you mean by "to what you describe above". 1. To change `LaTeX-verbatim-p' to return non-nil just before "\begin{verbatim}", keeping the current behavior at just before "\verb..."? 2. To change `LaTeX-verbatim-p' to return nil just before "\verb..."? Reading again my paragraphs, my opinion wasn't clear enough probably. I feel that it isn't natural that `LaTeX-verbatim-p' returns non-nil just before "\begin{verbatim}". Taking into account `TeX-insert-dollar' behavior as well, I'm still in favor of changing it to return nil just before "\verb..." as my first patch, keeping the current behavior just before "\begin{verbatim}". That's the reason why I feel reluctant. > Note that I had to apply the patch attached on top of yours in order > to get it working (some trouble with parens). I've also adjusted the > comment (the optional arg of \lstinline was already there). Oops, sorry for those! =F0=9F=98=B5 >> (By the way, I noticed that `LaTeX-verbatim-p' raises error when "\verb" >> is at the end of the buffer without delimiters and its contents "|...|". >> In fact `LaTeX-verbatim-macro-boundaries' and >> `LaTeX-current-verbatim-macro' raise the same error. The reason is that >> `LaTeX-verbatim-macro-boundaries' presumes there is nonempty string >> after the macro body. Should we cater for such corner case?) > I'd say let's fix the issue at hand and then see if others complain and > there is a real use for this corner case, and then we can touch that. > Does it make sense? I see, let's do so. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Arash Esbati Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Wed, 15 Feb 2023 08:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Ikumi Keita Cc: 61400@debbugs.gnu.org, Tassilo Horn Received: via spool by 61400-submit@debbugs.gnu.org id=B61400.167645052715995 (code B ref 61400); Wed, 15 Feb 2023 08:43:02 +0000 Received: (at 61400) by debbugs.gnu.org; 15 Feb 2023 08:42:07 +0000 Received: from localhost ([127.0.0.1]:57685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSDMd-00049u-G8 for submit@debbugs.gnu.org; Wed, 15 Feb 2023 03:42:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSDMb-00049H-Bb for 61400@debbugs.gnu.org; Wed, 15 Feb 2023 03:42:05 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSDMU-0000J8-Ar; Wed, 15 Feb 2023 03:41:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=wluqwhJmSO+7SIRfRtGVPAVwlCZvfeWmKPreMnug0X4=; b=metQ0qH0xC2Xk6MAoLmL hDtelcZ/jICYJ9zGVsnv4f+okHtfZWRbTwYbENi98YKIh+zQutKlB5XcQ7vgUZUP/RsSZE9oU+6fw Sb6zZgoEIPAwz2B6xLubo0ceuO2HDcJ1WYQhTB5EPlZlYFgxJ7jooxB8PGSw4/026/EZTby8MWu6v ZYo7oOydv6XzdMBfDytyC35QQpCVztwwuS1ZuEwxWK9xIjqrm2SV6akNlywFsZg9z62rkRR58HyKs S/qqNYKlhWMXXSBHSWGLXMUPtnS2ZCoHMj5JC/Axw7T72h0AH9+I6dqWL9axIAAvVUNELE7wdqpW4 S01qJyc+j1urNQ==; Received: from p5b326467.dip0.t-ipconnect.de ([91.50.100.103] helo=MUTANT) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSDMT-0004Ne-ER; Wed, 15 Feb 2023 03:41:57 -0500 From: Arash Esbati In-Reply-To: <8749.1676442652@localhost> (Ikumi Keita's message of "Wed, 15 Feb 2023 15:30:52 +0900") References: <86lel56gxq.fsf@gnu.org> <87edqx7tyw.fsf@gnu.org> <86h6vt6edv.fsf@gnu.org> <87a61l7rsm.fsf@gnu.org> <86sffdvjc7.fsf@gnu.org> <77898.1676105752@localhost> <86o7pzku7s.fsf@gnu.org> <87312.1676215926@localhost> <86fsb97rhs.fsf@gnu.org> <1773.1676357213@localhost> <865yc4wnd6.fsf@gnu.org> <8749.1676442652@localhost> Date: Wed, 15 Feb 2023 09:37:42 +0100 Message-ID: <86zg9fmii1.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) 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 (---) Hi Keita, Ikumi Keita writes: > Taking into account `TeX-insert-dollar' behavior as well, I'm still in > favor of changing it to return nil just before "\verb..." as my first > patch, keeping the current behavior just before "\begin{verbatim}". Sorry for the confusion. I wanted to say that I like your suggestion above, let's take this route :-) Best, Arash From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Ikumi Keita Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Wed, 15 Feb 2023 11:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Arash Esbati Cc: 61400@debbugs.gnu.org, Tassilo Horn Received: via spool by 61400-submit@debbugs.gnu.org id=B61400.16764605992013 (code B ref 61400); Wed, 15 Feb 2023 11:30:02 +0000 Received: (at 61400) by debbugs.gnu.org; 15 Feb 2023 11:29:59 +0000 Received: from localhost ([127.0.0.1]:58025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSFz4-0000WO-EI for submit@debbugs.gnu.org; Wed, 15 Feb 2023 06:29:58 -0500 Received: from smtp1a.inetd.co.jp ([210.129.88.11]:34930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSFz1-0000WC-MP for 61400@debbugs.gnu.org; Wed, 15 Feb 2023 06:29:56 -0500 Received: from localhost (42-144-46-173.rev.home.ne.jp [42.144.46.173]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id C7F8077; Wed, 15 Feb 2023 20:29:53 +0900 (JST) From: Ikumi Keita In-reply-to: <86zg9fmii1.fsf@gnu.org> References: <86lel56gxq.fsf@gnu.org> <87edqx7tyw.fsf@gnu.org> <86h6vt6edv.fsf@gnu.org> <87a61l7rsm.fsf@gnu.org> <86sffdvjc7.fsf@gnu.org> <77898.1676105752@localhost> <86o7pzku7s.fsf@gnu.org> <87312.1676215926@localhost> <86fsb97rhs.fsf@gnu.org> <1773.1676357213@localhost> <865yc4wnd6.fsf@gnu.org> <8749.1676442652@localhost> <86zg9fmii1.fsf@gnu.org> Comments: In-reply-to Arash Esbati message dated "Wed, 15 Feb 2023 09:37:42 +0100." X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 28.2 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Date: Wed, 15 Feb 2023 20:29:52 +0900 Message-ID: <13246.1676460592@localhost> 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 (-) --=-=-= Content-Type: text/plain Hi Arash, >>>>> Arash Esbati writes: > Sorry for the confusion. I wanted to say that I like your suggestion > above, let's take this route :-) Thanks, now I'd like to push the attached commit. Any comments welcome. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fill-verb-like-macros-appropriately-bug-61400.patch Content-Description: push candidate >From f3a8bd6751f4b1ff530d47a8b47eac4bbfca90dc Mon Sep 17 00:00:00 2001 From: Ikumi Keita Date: Wed, 15 Feb 2023 19:57:28 +0900 Subject: [PATCH] Fill \verb-like macros appropriately (bug#61400) * latex.el (LaTeX-verbatim-macro-boundaries): Attach an optional argument so that it can return boundaries of its argument only. Include *-braces verbatim macros like \url{} as targets. This affects `LaTeX-current-verbatim-macro' in the same way. Clean up codes to fix the following bugs. (1) Inconsistent result when the point is at just before "\verb...". (2) Going back to the previous line unintentionally in search of verbatim macros. Support optional argument of macros such as \Verb from fancyvrb. (LaTeX-verbatim-p): Don't regard the point just before "\verb..." as verbatim. Depend only on syntax-table property when syntax propertize is used. --- latex.el | 78 +++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 54 insertions(+), 24 deletions(-) diff --git a/latex.el b/latex.el index fb862b76..03795cf4 100644 --- a/latex.el +++ b/latex.el @@ -3780,46 +3780,67 @@ values of the variable `LaTeX-verbatim-environments' as well.") (append LaTeX-verbatim-environments LaTeX-verbatim-environments-local)) -(defun LaTeX-verbatim-macro-boundaries () - "Return boundaries of verbatim macro. +(defun LaTeX-verbatim-macro-boundaries (&optional arg-only) + "Return boundaries of verbatim macro containing point. Boundaries are returned as a cons cell where the car is the macro start and the cdr the macro end. -Only macros which enclose their arguments with special -non-parenthetical delimiters, like \\verb+foo+, are recognized." +If optional argument ARG-ONLY is non-nil, return the inner region +of the macro argument as cons." (save-excursion (let ((orig (point)) - (verbatim-regexp (regexp-opt (LaTeX-verbatim-macros-with-delims) t))) + (verbatim-regexp (regexp-opt + (append (LaTeX-verbatim-macros-with-delims) + (LaTeX-verbatim-macros-with-braces)) + t))) ;; Search backwards for the macro start, unless we are facing one - (unless (looking-at (concat (regexp-quote TeX-esc) verbatim-regexp)) - (catch 'found - (while (progn - (skip-chars-backward (concat "^\n" (regexp-quote TeX-esc)) - (line-beginning-position)) - (when (looking-at verbatim-regexp) (throw 'found nil)) - (or (bobp) (forward-char -1)) - (/= (point) (line-beginning-position)))))) + (if (looking-at (concat (regexp-quote TeX-esc) verbatim-regexp)) + (forward-char 1) + (while (progn + (skip-chars-backward (concat "^" (regexp-quote TeX-esc)) + (line-beginning-position)) + (if (or (bolp) + (looking-at verbatim-regexp)) + ;; Terminate the loop. + nil + (forward-char -1) + ;; Continue the loop. + t)))) ;; Search forward for the macro end, unless we failed to find a start (unless (bolp) (let* ((beg (1- (point))) - (macro-end (match-end 0)) + (end (match-end 0)) ;; XXX: Here we assume we are dealing with \verb which ;; expects the delimiter right behind the command. ;; However, \lstinline can also cope with whitespace as ;; well as an optional argument after the command. - (delimiter (buffer-substring-no-properties - macro-end (1+ macro-end)))) + ;; \Verb (from fancyvrb) also accepts an optional + ;; argument which we have to encounter. We assume that + ;; users don't write something like this '\Verb[foo[' + ;; and again the delimiter is directly after the ] + ;; closing the optional argument: + (delimiter (progn + (if (= (char-after end) (aref LaTeX-optop 0)) + ;; Update `end'. + (save-excursion (goto-char end) + (forward-list) + (setq end (point)))) + (string (char-after end))))) ;; Heuristic: If an opening brace is encountered, search for ;; both the opening and the closing brace as an end marker. ;; Like that the function should work for \verb|...| as well ;; as for \url{...}. (when (string= delimiter TeX-grop) (setq delimiter (concat delimiter TeX-grcl))) - (goto-char (1+ macro-end)) + (goto-char (1+ end)) (skip-chars-forward (concat "^" delimiter)) (when (<= orig (point)) - (cons beg (1+ (point))))))))) + (if arg-only + (cons (1+ end) (point)) + (cons beg (1+ (point)))))))))) +;; Currently, AUCTeX doesn't use this function at all. We leave it as +;; a utility function. It was originally used in `LaTeX-verbatim-p'. (defun LaTeX-current-verbatim-macro () "Return name of verbatim macro containing point, nil if none is present." (let ((macro-boundaries (LaTeX-verbatim-macro-boundaries))) @@ -3831,16 +3852,25 @@ non-parenthetical delimiters, like \\verb+foo+, are recognized." (point) (progn (skip-chars-forward "@A-Za-z*") (point))))))) (defun LaTeX-verbatim-p (&optional pos) - "Return non-nil if position POS is in a verbatim-like construct." + "Return non-nil if position POS is in a verbatim-like construct. +The macro body (\"\\verb\") and its delimiters, including +optional argument if any, aren't considered as component of a +verbatim-like construct." (when pos (goto-char pos)) (save-match-data - (or (progn + ;; TODO: Factor out syntax propertize facility from font-latex.el + ;; and re-implement as major mode feature. Then we can drop the + ;; fallback code below. + (if (eq TeX-install-font-lock 'font-latex-setup) + (progn (syntax-propertize (point)) (nth 3 (syntax-ppss))) - (member (LaTeX-current-verbatim-macro) - (LaTeX-verbatim-macros-with-delims)) - (member (TeX-current-macro) (LaTeX-verbatim-macros-with-braces)) - (member (LaTeX-current-environment) (LaTeX-verbatim-environments))))) + ;; Fallback for users who stay away from font-latex. + (or + (let ((region (LaTeX-verbatim-macro-boundaries t))) + (and region + (<= (car region) (point) (cdr region)))) + (member (LaTeX-current-environment) (LaTeX-verbatim-environments)))))) ;;; Formatting -- 2.39.1 --=-=-=-- From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Arash Esbati Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Wed, 15 Feb 2023 17:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Ikumi Keita Cc: 61400@debbugs.gnu.org, Tassilo Horn Received: via spool by 61400-submit@debbugs.gnu.org id=B61400.167648272611501 (code B ref 61400); Wed, 15 Feb 2023 17:39:02 +0000 Received: (at 61400) by debbugs.gnu.org; 15 Feb 2023 17:38:46 +0000 Received: from localhost ([127.0.0.1]:33859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSLjx-0002zQ-L8 for submit@debbugs.gnu.org; Wed, 15 Feb 2023 12:38:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52778) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSLjv-0002zE-VA for 61400@debbugs.gnu.org; Wed, 15 Feb 2023 12:38:44 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSLjo-0005e6-Qf; Wed, 15 Feb 2023 12:38:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=l7HBw47/L/YtT4BBjwk57Grlmu+I86fQ8KuOXL1JdoY=; b=Kyeaeu9bMCEkOeAZ61Tn Gy73G0sPwivG9rdTWLqiiF5yi7VsoR1JLCrevJspMikGMvba+S2aqoDm2rmEOcBfh8CaGvVtKfuyB zk/s0KlyLh+UWYCksSUjFrUhG5xgClx1XpQxe+Bmi05QevVSTshD2KtTLLhYOrYM0V6GHUkflnahX 6puKLmPfvPULgOMF9gBnjlC8/GMgNo8wv760nlQPyHmM1d+h4QuHakopgyOQDUUFew6SwdB4e87+e eHWyNF7CXohfN8+vklQ1SygM7yr9eufcjZCZO+ABpvjMUy51CxnDWZhBRVZxrcwG0moipY6QKsuXE fd0VFNe8c7gfKg==; Received: from p5b326467.dip0.t-ipconnect.de ([91.50.100.103] helo=MUTANT) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSLjn-0005dl-JV; Wed, 15 Feb 2023 12:38:36 -0500 From: Arash Esbati In-Reply-To: <13246.1676460592@localhost> (Ikumi Keita's message of "Wed, 15 Feb 2023 20:29:52 +0900") References: <86lel56gxq.fsf@gnu.org> <87edqx7tyw.fsf@gnu.org> <86h6vt6edv.fsf@gnu.org> <87a61l7rsm.fsf@gnu.org> <86sffdvjc7.fsf@gnu.org> <77898.1676105752@localhost> <86o7pzku7s.fsf@gnu.org> <87312.1676215926@localhost> <86fsb97rhs.fsf@gnu.org> <1773.1676357213@localhost> <865yc4wnd6.fsf@gnu.org> <8749.1676442652@localhost> <86zg9fmii1.fsf@gnu.org> <13246.1676460592@localhost> Date: Wed, 15 Feb 2023 18:36:44 +0100 Message-ID: <86h6vmsudv.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) 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 (---) Hi Keita, Ikumi Keita writes: > Thanks, now I'd like to push the attached commit. Any comments welcome. Thanks, I think I have one minor comment. Take this example: --8<---------------cut here---------------start------------->8--- \documentclass{article} \usepackage{fvextra} \begin{document} \Verb{pre\cmd{test}p*st} \end{document} --8<---------------cut here---------------end--------------->8--- Put point on * and try M-: (LaTeX-verbatim-macro-boundaries) RET which returns nil. This is due to this part of the function: (when (string= delimiter TeX-grop) (setq delimiter (concat delimiter TeX-grcl))) (goto-char (1+ end)) (skip-chars-forward (concat "^" delimiter)) What I don't understand it why the code does: (when (string= delimiter TeX-grop) (setq delimiter (concat delimiter TeX-grcl))) which is "^{}"; I would have expected "^}" only because using \verb{foo{ is just asking for trouble and not officially supported IIRC. Even with delimiter being "^}", this form: (skip-chars-forward (concat "^" delimiter)) means stop before the first "}" which is not far enough in case we have balanced braces in the argument (and only such are allowed). So I suggest we change this part of the code like this: --8<---------------cut here---------------start------------->8--- diff --git a/latex.el b/latex.el index 03795cf4..bbb8cd29 100644 --- a/latex.el +++ b/latex.el @@ -3830,10 +3830,14 @@ of the macro argument as cons." ;; both the opening and the closing brace as an end marker. ;; Like that the function should work for \verb|...| as well ;; as for \url{...}. - (when (string= delimiter TeX-grop) - (setq delimiter (concat delimiter TeX-grcl))) - (goto-char (1+ end)) - (skip-chars-forward (concat "^" delimiter)) + (if (string= delimiter TeX-grop) + (progn + (goto-char end) + (re-search-forward "{[^}{]*\\(?:{[^}{]*}[^}{]*\\)*}" + (line-end-position) t) + (backward-char)) + (goto-char (1+ end)) + (skip-chars-forward (concat "^" delimiter))) (when (<= orig (point)) (if arg-only (cons (1+ end) (point)) --8<---------------cut here---------------end--------------->8--- Then we only need to solve the fontification issue ;-) WDYT? Best, Arash From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Ikumi Keita Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Thu, 16 Feb 2023 08:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Arash Esbati Cc: 61400@debbugs.gnu.org, Tassilo Horn Received: via spool by 61400-submit@debbugs.gnu.org id=B61400.16765377388653 (code B ref 61400); Thu, 16 Feb 2023 08:56:02 +0000 Received: (at 61400) by debbugs.gnu.org; 16 Feb 2023 08:55:38 +0000 Received: from localhost ([127.0.0.1]:34851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSa3G-0002FV-78 for submit@debbugs.gnu.org; Thu, 16 Feb 2023 03:55:38 -0500 Received: from smtp1a.inetd.co.jp ([210.129.88.11]:37650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSa3D-0002FK-Gs for 61400@debbugs.gnu.org; Thu, 16 Feb 2023 03:55:37 -0500 Received: from localhost (42-144-46-173.rev.home.ne.jp [42.144.46.173]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id 3E7D25C; Thu, 16 Feb 2023 17:55:33 +0900 (JST) From: Ikumi Keita In-reply-to: <86h6vmsudv.fsf@gmail.com> References: <86lel56gxq.fsf@gnu.org> <87edqx7tyw.fsf@gnu.org> <86h6vt6edv.fsf@gnu.org> <87a61l7rsm.fsf@gnu.org> <86sffdvjc7.fsf@gnu.org> <77898.1676105752@localhost> <86o7pzku7s.fsf@gnu.org> <87312.1676215926@localhost> <86fsb97rhs.fsf@gnu.org> <1773.1676357213@localhost> <865yc4wnd6.fsf@gnu.org> <8749.1676442652@localhost> <86zg9fmii1.fsf@gnu.org> <13246.1676460592@localhost> <86h6vmsudv.fsf@gmail.com> Comments: In-reply-to Arash Esbati message dated "Wed, 15 Feb 2023 18:36:44 +0100." X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 28.2 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Date: Thu, 16 Feb 2023 17:55:32 +0900 Message-ID: <18052.1676537732@localhost> 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 (-) --=-=-= Content-Type: text/plain Hi Arash, >>>>> Arash Esbati writes: > What I don't understand it why the code does: > (when (string= delimiter TeX-grop) > (setq delimiter (concat delimiter TeX-grcl))) > which is "^{}"; I would have expected "^}" only because using \verb{foo{ > is just asking for trouble and not officially supported IIRC. That's what I was wondering too. > Even with delimiter being "^}", this form: > (skip-chars-forward (concat "^" delimiter)) > means stop before the first "}" which is not far enough in case we have > balanced braces in the argument (and only such are allowed). So I > suggest we change this part of the code like this: [...] > Then we only need to solve the fontification issue ;-) WDYT? Thanks, I included your suggestion. See the attachment. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fill-verb-like-macros-appropriately-bug-61400.patch Content-Description: revised patch >From 9ab61ba53e7491c8d9d46eb9a5a2187877eb0854 Mon Sep 17 00:00:00 2001 From: Ikumi Keita Date: Wed, 15 Feb 2023 19:57:28 +0900 Subject: [PATCH] Fill \verb-like macros appropriately (bug#61400) * latex.el (LaTeX-verbatim-macro-boundaries): Attach an optional argument so that it can return boundaries of its argument only. Include *-braces verbatim macros like \url{} as targets. This affects `LaTeX-current-verbatim-macro' in the same way. Clean up codes to fix the following bugs. (1) Inconsistent result when the point is at just before "\verb...". (2) Going back to the previous line unintentionally in search of verbatim macros. Support optional argument of macros such as \Verb from fancyvrb. Allow one level of nested braces as verb argument. (LaTeX-verbatim-p): Don't regard the point just before "\verb..." as verbatim. Depend only on syntax-table property when syntax propertize is used. --- latex.el | 89 +++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 62 insertions(+), 27 deletions(-) diff --git a/latex.el b/latex.el index fb862b76..e2419422 100644 --- a/latex.el +++ b/latex.el @@ -3780,46 +3780,72 @@ values of the variable `LaTeX-verbatim-environments' as well.") (append LaTeX-verbatim-environments LaTeX-verbatim-environments-local)) -(defun LaTeX-verbatim-macro-boundaries () - "Return boundaries of verbatim macro. +(defun LaTeX-verbatim-macro-boundaries (&optional arg-only) + "Return boundaries of verbatim macro containing point. Boundaries are returned as a cons cell where the car is the macro start and the cdr the macro end. -Only macros which enclose their arguments with special -non-parenthetical delimiters, like \\verb+foo+, are recognized." +If optional argument ARG-ONLY is non-nil, return the inner region +of the macro argument as cons." (save-excursion (let ((orig (point)) - (verbatim-regexp (regexp-opt (LaTeX-verbatim-macros-with-delims) t))) + (verbatim-regexp (regexp-opt + (append (LaTeX-verbatim-macros-with-delims) + (LaTeX-verbatim-macros-with-braces)) + t))) ;; Search backwards for the macro start, unless we are facing one - (unless (looking-at (concat (regexp-quote TeX-esc) verbatim-regexp)) - (catch 'found - (while (progn - (skip-chars-backward (concat "^\n" (regexp-quote TeX-esc)) - (line-beginning-position)) - (when (looking-at verbatim-regexp) (throw 'found nil)) - (or (bobp) (forward-char -1)) - (/= (point) (line-beginning-position)))))) + (if (looking-at (concat (regexp-quote TeX-esc) verbatim-regexp)) + (forward-char 1) + (while (progn + (skip-chars-backward (concat "^" (regexp-quote TeX-esc)) + (line-beginning-position)) + (if (or (bolp) + (looking-at verbatim-regexp)) + ;; Terminate the loop. + nil + (forward-char -1) + ;; Continue the loop. + t)))) ;; Search forward for the macro end, unless we failed to find a start (unless (bolp) (let* ((beg (1- (point))) - (macro-end (match-end 0)) + (end (match-end 0)) ;; XXX: Here we assume we are dealing with \verb which ;; expects the delimiter right behind the command. ;; However, \lstinline can also cope with whitespace as ;; well as an optional argument after the command. - (delimiter (buffer-substring-no-properties - macro-end (1+ macro-end)))) + ;; \Verb (from fancyvrb) also accepts an optional + ;; argument which we have to encounter. We assume that + ;; users don't write something like this '\Verb[foo[' + ;; and again the delimiter is directly after the ] + ;; closing the optional argument: + (delimiter (progn + (if (= (char-after end) (aref LaTeX-optop 0)) + ;; Update `end'. + (save-excursion (goto-char end) + (forward-list) + (setq end (point)))) + (string (char-after end))))) ;; Heuristic: If an opening brace is encountered, search for ;; both the opening and the closing brace as an end marker. ;; Like that the function should work for \verb|...| as well ;; as for \url{...}. - (when (string= delimiter TeX-grop) - (setq delimiter (concat delimiter TeX-grcl))) - (goto-char (1+ macro-end)) - (skip-chars-forward (concat "^" delimiter)) + (if (string= delimiter TeX-grop) + (progn + (goto-char end) + ;; Allow one level of nested braces as verb argument. + (re-search-forward "{[^}{]*\\(?:{[^}{]*}[^}{]*\\)*}" + (line-end-position) t) + (backward-char)) + (goto-char (1+ end)) + (skip-chars-forward (concat "^" delimiter))) (when (<= orig (point)) - (cons beg (1+ (point))))))))) + (if arg-only + (cons (1+ end) (point)) + (cons beg (1+ (point)))))))))) +;; Currently, AUCTeX doesn't use this function at all. We leave it as +;; a utility function. It was originally used in `LaTeX-verbatim-p'. (defun LaTeX-current-verbatim-macro () "Return name of verbatim macro containing point, nil if none is present." (let ((macro-boundaries (LaTeX-verbatim-macro-boundaries))) @@ -3831,16 +3857,25 @@ non-parenthetical delimiters, like \\verb+foo+, are recognized." (point) (progn (skip-chars-forward "@A-Za-z*") (point))))))) (defun LaTeX-verbatim-p (&optional pos) - "Return non-nil if position POS is in a verbatim-like construct." + "Return non-nil if position POS is in a verbatim-like construct. +The macro body (\"\\verb\") and its delimiters, including +optional argument if any, aren't considered as component of a +verbatim-like construct." (when pos (goto-char pos)) (save-match-data - (or (progn + ;; TODO: Factor out syntax propertize facility from font-latex.el + ;; and re-implement as major mode feature. Then we can drop the + ;; fallback code below. + (if (eq TeX-install-font-lock 'font-latex-setup) + (progn (syntax-propertize (point)) (nth 3 (syntax-ppss))) - (member (LaTeX-current-verbatim-macro) - (LaTeX-verbatim-macros-with-delims)) - (member (TeX-current-macro) (LaTeX-verbatim-macros-with-braces)) - (member (LaTeX-current-environment) (LaTeX-verbatim-environments))))) + ;; Fallback for users who stay away from font-latex. + (or + (let ((region (LaTeX-verbatim-macro-boundaries t))) + (and region + (<= (car region) (point) (cdr region)))) + (member (LaTeX-current-environment) (LaTeX-verbatim-environments)))))) ;;; Formatting -- 2.39.1 --=-=-=-- From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Arash Esbati Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Thu, 16 Feb 2023 09:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Ikumi Keita Cc: 61400@debbugs.gnu.org, Tassilo Horn Received: via spool by 61400-submit@debbugs.gnu.org id=B61400.167654013312779 (code B ref 61400); Thu, 16 Feb 2023 09:36:01 +0000 Received: (at 61400) by debbugs.gnu.org; 16 Feb 2023 09:35:33 +0000 Received: from localhost ([127.0.0.1]:34907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSaft-0003K3-2m for submit@debbugs.gnu.org; Thu, 16 Feb 2023 04:35:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58936) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSafq-0003Jp-Iw for 61400@debbugs.gnu.org; Thu, 16 Feb 2023 04:35:31 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSafQ-0003kq-6U; Thu, 16 Feb 2023 04:35:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=b8QN8iun7qxstwyxZt26Ovg26wf80BN3LfskjOP3dXo=; b=nrdwj0ZhuCCn1pTh+VpC 5xq1e4GY1rS1hhckWKJzezAlCnK41qTUflgeFoZ6PpC6pVJLBHcH/h9uG8hfI6D4MS2hm6ckGj0sI Inmpzq0B9uGPR7K+XrXZPPQM0l/a52YOAzIpA7vzFQh6zDxUUVXM9aRMhXKPAGfN/O8hcrX0/cse4 NaPu580hFWzGrvf/rGvtVotp/SAoHAFJmeBlZO4yluxfzpqZ0rP7hO4X0VfYXwqO0SK6ngZXgVCwh u81x8F1621QCXwhLTZfj55Cl+/+i2zEAuJ6NMi8BCf4asJHXlcgm2kxrbIRRgx44s5ovmtC1+nD+q Pr60G69Z8zKnBg==; Received: from p5b326467.dip0.t-ipconnect.de ([91.50.100.103] helo=MUTANT) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSafN-0004mN-HW; Thu, 16 Feb 2023 04:35:02 -0500 From: Arash Esbati In-Reply-To: <18052.1676537732@localhost> (Ikumi Keita's message of "Thu, 16 Feb 2023 17:55:32 +0900") References: <86lel56gxq.fsf@gnu.org> <87edqx7tyw.fsf@gnu.org> <86h6vt6edv.fsf@gnu.org> <87a61l7rsm.fsf@gnu.org> <86sffdvjc7.fsf@gnu.org> <77898.1676105752@localhost> <86o7pzku7s.fsf@gnu.org> <87312.1676215926@localhost> <86fsb97rhs.fsf@gnu.org> <1773.1676357213@localhost> <865yc4wnd6.fsf@gnu.org> <8749.1676442652@localhost> <86zg9fmii1.fsf@gnu.org> <13246.1676460592@localhost> <86h6vmsudv.fsf@gmail.com> <18052.1676537732@localhost> Date: Thu, 16 Feb 2023 10:34:48 +0100 Message-ID: <865yc2osw7.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) 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 (---) Hi Keita, Ikumi Keita writes: > Thanks, I included your suggestion. See the attachment. LGTM. Please go ahead and install so we can close this report. Please just adjust the comment below before pushing: > ;; Heuristic: If an opening brace is encountered, search for > ;; both the opening and the closing brace as an end marker. I think now this should read: ;; Heuristic: If an opening brace is encountered, search for ;; a closing brace as an end marker. Thanks for working on this. Best, Arash From unknown Tue Aug 19 10:09:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61400: Different filling for verbatim macros Resent-From: Ikumi Keita Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Thu, 16 Feb 2023 12:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61400 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: Arash Esbati Cc: 61400@debbugs.gnu.org, Tassilo Horn Received: via spool by 61400-submit@debbugs.gnu.org id=B61400.167654910028394 (code B ref 61400); Thu, 16 Feb 2023 12:05:01 +0000 Received: (at 61400) by debbugs.gnu.org; 16 Feb 2023 12:05:00 +0000 Received: from localhost ([127.0.0.1]:35066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSd0W-0007Nt-1Y for submit@debbugs.gnu.org; Thu, 16 Feb 2023 07:05:00 -0500 Received: from smtp1a.inetd.co.jp ([210.129.88.11]:38034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSd0R-0007Nh-Te for 61400@debbugs.gnu.org; Thu, 16 Feb 2023 07:04:58 -0500 Received: from localhost (42-144-46-173.rev.home.ne.jp [42.144.46.173]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id DDB415F; Thu, 16 Feb 2023 21:04:53 +0900 (JST) From: Ikumi Keita In-reply-to: <865yc2osw7.fsf@gnu.org> References: <86lel56gxq.fsf@gnu.org> <87edqx7tyw.fsf@gnu.org> <86h6vt6edv.fsf@gnu.org> <87a61l7rsm.fsf@gnu.org> <86sffdvjc7.fsf@gnu.org> <77898.1676105752@localhost> <86o7pzku7s.fsf@gnu.org> <87312.1676215926@localhost> <86fsb97rhs.fsf@gnu.org> <1773.1676357213@localhost> <865yc4wnd6.fsf@gnu.org> <8749.1676442652@localhost> <86zg9fmii1.fsf@gnu.org> <13246.1676460592@localhost> <86h6vmsudv.fsf@gmail.com> <18052.1676537732@localhost> <865yc2osw7.fsf@gnu.org> Comments: In-reply-to Arash Esbati message dated "Thu, 16 Feb 2023 10:34:48 +0100." X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 28.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19884.1676549093.1@localhost> Date: Thu, 16 Feb 2023 21:04:53 +0900 Message-ID: <19888.1676549093@localhost> 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 (-) Hi Arash, >>>>> Arash Esbati writes: > LGTM. Please go ahead and install so we can close this report. Please > just adjust the comment below before pushing: >> ;; Heuristic: If an opening brace is encountered, search for >> ;; both the opening and the closing brace as an end marker. > I think now this should read: > ;; Heuristic: If an opening brace is encountered, search for > ;; a closing brace as an end marker. Done. I also changed (skip-chars-forward (concat "^" delimiter))) to (skip-chars-forward (concat "^" delimiter) (line-end-position))) , which isn't important much. (It makes difference only when closing delimiter is missing. In that case, the function doesn't return sensible result anyway.) Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine From unknown Tue Aug 19 10:09:39 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Arash Esbati Subject: bug#61400: closed (Re: bug#61400: Different filling for verbatim macros) Message-ID: References: <86h6vl93lm.fsf@gnu.org> <86lel56gxq.fsf@gnu.org> X-Gnu-PR-Message: they-closed 61400 X-Gnu-PR-Package: auctex Reply-To: 61400@debbugs.gnu.org Date: Thu, 16 Feb 2023 12:51:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1676551862-9633-1" This is a multi-part message in MIME format... ------------=_1676551862-9633-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #61400: Different filling for verbatim macros which was filed against the auctex package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 61400@debbugs.gnu.org. --=20 61400: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D61400 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1676551862-9633-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 61400-done) by debbugs.gnu.org; 16 Feb 2023 12:50:42 +0000 Received: from localhost ([127.0.0.1]:35148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSdik-0002UE-62 for submit@debbugs.gnu.org; Thu, 16 Feb 2023 07:50:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSdih-0002Ty-SI for 61400-done@debbugs.gnu.org; Thu, 16 Feb 2023 07:50:40 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSdia-0004Rq-Tl; Thu, 16 Feb 2023 07:50:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=cKlnPRJRvLLxkmqEQrkjjNiNArUSqGV9yibpvg9gfRA=; b=Xw71gD3idUgaIPB0PpA5 YBJNhSLPxF/arBrhh5pMqPlzKW8uRyX+WeDRxKA9JvCUf9EzyS4J9DHLFvRKqqcu6YPunD1wzc6YY qgKjmk8reiBAvLnIH2lVQkBabc/D3M7fQClYtV7A6gP8Sq4/RRnYCxzpOLHPhtz9KiZWIqOCnIoKv HLCG4LlAf4iKqs9sJxVwHhX/zArmgMY9XydSnksrNX5y7CRbq+jbp/6MGO3IGoOrLBunoWCbHG6HF /spJ6gSEytO9TPPozOu+ge1oY7hxE1l7eg9bOBgHNfBU5v0eeaVzMWZBSZmnIi+1iUeg/KZlyIsFv FmO3Cwk1xVnKgw==; Received: from p5b326467.dip0.t-ipconnect.de ([91.50.100.103] helo=MUTANT) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSdiW-0008To-7y; Thu, 16 Feb 2023 07:50:30 -0500 From: Arash Esbati To: Ikumi Keita Subject: Re: bug#61400: Different filling for verbatim macros In-Reply-To: <19888.1676549093@localhost> (Ikumi Keita's message of "Thu, 16 Feb 2023 21:04:53 +0900") References: <86lel56gxq.fsf@gnu.org> <87edqx7tyw.fsf@gnu.org> <86h6vt6edv.fsf@gnu.org> <87a61l7rsm.fsf@gnu.org> <86sffdvjc7.fsf@gnu.org> <77898.1676105752@localhost> <86o7pzku7s.fsf@gnu.org> <87312.1676215926@localhost> <86fsb97rhs.fsf@gnu.org> <1773.1676357213@localhost> <865yc4wnd6.fsf@gnu.org> <8749.1676442652@localhost> <86zg9fmii1.fsf@gnu.org> <13246.1676460592@localhost> <86h6vmsudv.fsf@gmail.com> <18052.1676537732@localhost> <865yc2osw7.fsf@gnu.org> <19888.1676549093@localhost> Date: Thu, 16 Feb 2023 13:50:13 +0100 Message-ID: <86h6vl93lm.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61400-done Cc: 61400-done@debbugs.gnu.org, Tassilo Horn 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 (---) Hi Keita, Ikumi Keita writes: > Done. I also changed > (skip-chars-forward (concat "^" delimiter))) > to > (skip-chars-forward (concat "^" delimiter) (line-end-position))) many thanks for fixing this issue. I'm therefore closing this report. Best, Arash ------------=_1676551862-9633-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 10 Feb 2023 08:52:39 +0000 Received: from localhost ([127.0.0.1]:34313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQP95-00026e-As for submit@debbugs.gnu.org; Fri, 10 Feb 2023 03:52:39 -0500 Received: from lists.gnu.org ([209.51.188.17]:56622) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQP92-00026U-3A for submit@debbugs.gnu.org; Fri, 10 Feb 2023 03:52:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQP91-0005RE-7n for bug-auctex@gnu.org; Fri, 10 Feb 2023 03:52:35 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQP90-0000RJ-P6 for bug-auctex@gnu.org; Fri, 10 Feb 2023 03:52:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=jaQanNnGlXWqF23jyEa7nkItEAIVd1w3l2qNO6Ft4L4=; b=ekO+tq2fPydeBZ iRFrq9/k60BX0Fbp+B35+JCw9ItAJ+sNG7t50+MesI+QOQ0NIBpmivzNOF6PoPNHaK7oMoGoE/ZmO oLlGsVDVn6zcdBhJoq2Hw5ARC34l8lsGfQVJYWoQ5OSbizdm09iFd0Ib8G48AYVJWofiicd4JXXW4 FzzxW57vulXFyiAc2rewwmHkAiZMYv83/Be3oiwLL/IxGyO9AbWiZ3+m1itUv9DBLbux6k1VDs72f QwVuyv/cftIlqVjFP2nyYQdgiFb/t4aowjRLR/j0ls8vwx/hfifQWG+nPd19OlJcTim/1p/tD2Sxe 3LennQ/7IiWOJKzuGwRw==; Received: from p5b326467.dip0.t-ipconnect.de ([91.50.100.103] helo=MUTANT) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQP90-0001lF-1x for bug-auctex@gnu.org; Fri, 10 Feb 2023 03:52:34 -0500 From: Arash Esbati To: auctex-bugs Subject: Different filling for verbatim macros Date: Fri, 10 Feb 2023 09:52:17 +0100 Message-ID: <86lel56gxq.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) 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: -3.3 (---) Hi all, please set `TeX-parse-self' to t and load this small file: --8<---------------cut here---------------start------------->8--- \documentclass{article} \usepackage{url} \usepackage{fvextra} \begin{document} Now we can write some text foo and \path{bar} Now we can write some text foo and \path|bar| Now we can write some text foo and \Verb|bar| Now we can write some text foo and \Verb{bar} Now we can write some text foo and \verb|bar| \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% fill-column: 40 %%% End: --8<---------------cut here---------------end--------------->8--- Now mark the five lines and hit 'M-q'. I get: --8<---------------cut here---------------start------------->8--- \documentclass{article} \usepackage{url} \usepackage{fvextra} \begin{document} Now we can write some text foo and \path{bar} Now we can write some text foo and \path|bar| Now we can write some text foo and \Verb|bar| Now we can write some text foo and \Verb{bar} Now we can write some text foo and \verb|bar| \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% fill-column: 40 %%% End: --8<---------------cut here---------------end--------------->8--- Any idea what the reason is for the different break points? This is with Emacs 30 (emacs -Q) and latest AUCTeX from Git. TIA. Best, Arash ------------=_1676551862-9633-1--