From 261dfc6bf20c04b07cd420153a3d487d12cfd136 Mon Sep 17 00:00:00 2001
From: Paul Nelson <ultrono@gmail.com>
Date: Sat, 24 Feb 2024 09:08:09 +0100
Subject: [PATCH] fix indentation issue involving \newcommand{...}

Make LaTeX-indent-level-count ignore the first argument of
\newcommand, so that declarations such as

"\newcommand{\ifs}{\text{if}}"

do not increment the level count due to the appearance of
if* (cf. LaTeX-indent-begin-regexp-local)
---
 latex.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/latex.el b/latex.el
index f56b5189..7a4f5a21 100644
--- a/latex.el
+++ b/latex.el
@@ -4380,6 +4380,8 @@ constructs.  A special case is \\newif where the following
             (setq count (- count LaTeX-indent-level)))
            ((looking-at "newif\\b")
             (search-forward TeX-esc (line-end-position) t))
+           ((looking-at "newcommand\\b")
+            (search-forward "}" nil t))
            ((and (not (looking-at LaTeX-indent-begin-regexp-exceptions-local))
                  (looking-at LaTeX-indent-begin-regexp-local))
             (setq count (+ count LaTeX-indent-level)))
-- 
2.39.3 (Apple Git-145)

