From debbugs-submit-bounces@debbugs.gnu.org Thu May 11 04:36:24 2023 Received: (at submit) by debbugs.gnu.org; 11 May 2023 08:36:25 +0000 Received: from localhost ([127.0.0.1]:49679 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1px1mi-0006Yj-JT for submit@debbugs.gnu.org; Thu, 11 May 2023 04:36:24 -0400 Received: from lists.gnu.org ([209.51.188.17]:60158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1px1mg-0006Yc-VB for submit@debbugs.gnu.org; Thu, 11 May 2023 04:36:24 -0400 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 1px1mg-0003S4-Q5 for bug-auctex@gnu.org; Thu, 11 May 2023 04:36:22 -0400 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 1px1mg-0007bS-Gi for bug-auctex@gnu.org; Thu, 11 May 2023 04:36:22 -0400 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=AUMECagijXLMr62FZ3GnSrxq40aLxPkQK2G9VHVpwcs=; b=Ui1O3AKyQRHx4S YZkwhkcduyPuDZWdn2q6ol9QI9rMxskhtOCZ3iQMpWHAeBp8V0in3c7LWM+dzLM/t7jTu1WKeoMOn d+dv53mMPGMp10ExxbapYZKY5u0P/2no8BYt2SWvGB+UcF22SSRDqrr9qkF0LIAFAtHkpzWa4xb9h v8wuwXNIYDya70bG1SaUPQJ6rdn6SPu+S2N2cQ791VdS9wpSvKxvssfobi1YIUOUwum0wphTGIyvH +/RffcbcpNpceYx/QX8rw2ev973b1v4dsqUZFKlp1kSOqu5Kf+7/rtEHUYru0j0U9FjUg5yVQeTEy 9AO89ndHn2YxbEDEt44g==; Received: from p5b326c3d.dip0.t-ipconnect.de ([91.50.108.61] helo=MUTANT) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1px1mf-0005eW-Bq for bug-auctex@gnu.org; Thu, 11 May 2023 04:36:22 -0400 From: Arash Esbati To: auctex-bugs Subject: Wrong Indentation with backslash in verb macros with braces Date: Thu, 11 May 2023 10:36:06 +0200 Message-ID: <86ilczcljd.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, I just installed a change (commit 0cb158fd96) which improves fontification of arguments of verb macros with braces. One addition is also handling of backslash(es) as last character(s) in the argument. There is a downside, though. Consider the following file: --8<---------------cut here---------------start------------->8--- \documentclass{article} \usepackage{url} \begin{document} This is text with \textbf{foo\} bar} \path{foobar\} next line \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% End: --8<---------------cut here---------------end--------------->8--- Now mark the text body and indent with 'M-x indent-region RET' or with C-M-\ and you get: --8<---------------cut here---------------start------------->8--- This is text with \textbf{foo\} bar} \path{foobar\} next line --8<---------------cut here---------------end--------------->8--- which is wrong. This is due to the implementation of `TeX-brace-count-line' which presumes that ?\\ always escapes the next char, which is wrong in verb macros. I can think of a solution like this: --8<---------------cut here---------------start------------->8--- diff --git a/tex.el b/tex.el index b862d3c2..4663b217 100644 --- a/tex.el +++ b/tex.el @@ -5485,7 +5485,9 @@ additional characters." (setq count (- count TeX-brace-indent-level))) ((eq char ?\\) (when (< (point) limit) - (forward-char) + (unless (and (fboundp 'LaTeX-verbatim-p) + (LaTeX-verbatim-p)) + (forward-char)) t)))))) count))) --8<---------------cut here---------------end--------------->8--- Any comments oder better approaches? Best, Arash From debbugs-submit-bounces@debbugs.gnu.org Thu May 11 09:47:09 2023 Received: (at 63441) by debbugs.gnu.org; 11 May 2023 13:47:09 +0000 Received: from localhost ([127.0.0.1]:50099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1px6dQ-0000Rf-P5 for submit@debbugs.gnu.org; Thu, 11 May 2023 09:47:09 -0400 Received: from smtp1a.inetd.co.jp ([210.129.88.11]:54126) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1px6dO-0000RU-ED for 63441@debbugs.gnu.org; Thu, 11 May 2023 09:47:07 -0400 Received: from localhost (42-144-46-173.rev.home.ne.jp [42.144.46.173]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id 4DA1F5F; Thu, 11 May 2023 22:47:04 +0900 (JST) From: Ikumi Keita To: Arash Esbati Subject: Re: bug#63441: Wrong Indentation with backslash in verb macros with braces In-reply-to: <86ilczcljd.fsf@gnu.org> References: <86ilczcljd.fsf@gnu.org> Comments: In-reply-to Arash Esbati message dated "Thu, 11 May 2023 10:36:06 +0200." 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: <97695.1683812821.1@localhost> Date: Thu, 11 May 2023 22:47:01 +0900 Message-ID: <97697.1683812821@localhost> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 63441 Cc: 63441@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Arash, >>>>> Arash Esbati writes: > which is wrong. This is due to the implementation of > `TeX-brace-count-line' which presumes that ?\\ always escapes the next > char, which is wrong in verb macros. I can think of a solution like > this: > diff --git a/tex.el b/tex.el > index b862d3c2..4663b217 100644 > --- a/tex.el > +++ b/tex.el > @@ -5485,7 +5485,9 @@ additional characters." > (setq count (- count TeX-brace-indent-level))) > ((eq char ?\\) > (when (< (point) limit) > - (forward-char) > + (unless (and (fboundp 'LaTeX-verbatim-p) > + (LaTeX-verbatim-p)) > + (forward-char)) > t)))))) > count))) > Any comments oder better approaches? I don't think `fboundp' test is a right approach because it calls `LaTeX-verbatim-p' even in non-LaTeX mode buffers after the session loads latex.el. How about just (TeX-verbatim-p) instead of (and (fboundp 'LaTeX-verbatim-p) (LaTeX-verbatim-p)) ? Bye, Ikumi Keita #StandWithUkraine #StopWarInUkraine From debbugs-submit-bounces@debbugs.gnu.org Thu May 11 15:42:50 2023 Received: (at 63441-done) by debbugs.gnu.org; 11 May 2023 19:42:50 +0000 Received: from localhost ([127.0.0.1]:53402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxCBe-0003O8-0I for submit@debbugs.gnu.org; Thu, 11 May 2023 15:42:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pxCBb-0003Nu-J6 for 63441-done@debbugs.gnu.org; Thu, 11 May 2023 15:42:49 -0400 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 1pxCBU-00007j-Dz; Thu, 11 May 2023 15:42:40 -0400 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=cQUb7S9MQZz8ItlG9M70KTBW2Qxr3M4wkAcktmlXQRw=; b=nqczpKfoQh/j+ivoK0n4 siFxoX8KUVt4KVw1i5v+HYFUwwQcgRqxXQZpVG2sBCYHwdbcCyubDEvVINpPNZt/zK9iLvMEXBeZN beV/layycFnM1gJsn+3Z5XpPKrMlKc33tziLO96l02dwmadpszvkI6NQGGl4ZI+spK3p90sEHGvVe /FgLdzfvMQa/XukaPLhbxKett6ETP8+H8AKZK524lKn2HmtLXlFchiQErcd/2dJwB1imRJehcJaAt vwxHwGWeMBaN0mXC+tFkR9RapBQDzmPmLFakGXK5+nkRtpe8/hsNhms12bN5rlUmXmxF322LQgouS foMKEgG5A8djHw==; Received: from p5b326c3d.dip0.t-ipconnect.de ([91.50.108.61] helo=MUTANT) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pxCBU-0006oG-0p; Thu, 11 May 2023 15:42:40 -0400 From: Arash Esbati To: Ikumi Keita Subject: Re: bug#63441: Wrong Indentation with backslash in verb macros with braces In-Reply-To: <97697.1683812821@localhost> (Ikumi Keita's message of "Thu, 11 May 2023 22:47:01 +0900") References: <86ilczcljd.fsf@gnu.org> <97697.1683812821@localhost> Date: Thu, 11 May 2023 21:42:22 +0200 Message-ID: <86lehuac4h.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: 63441-done Cc: 63441-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Keita, Ikumi Keita writes: > I don't think `fboundp' test is a right approach because it calls > `LaTeX-verbatim-p' even in non-LaTeX mode buffers after the session > loads latex.el. How about just > (TeX-verbatim-p) > instead of > (and (fboundp 'LaTeX-verbatim-p) > (LaTeX-verbatim-p)) > ? Thanks for reminding me, you're right, that's the way to go. I installed the change per your suggestion (commit 715a88a5f2). Closing this report. Best, Arash From unknown Sat Jun 21 03:24:57 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 09 Jun 2023 11:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator