Subject: bug#73832: [PATCH] Fix misplaced paren in c-ts-mode--anchor-prev-sibling

From: Noah Peart <[email-masked]>
Date: Tue, 15 Oct 2024 19:37:00 -0700

Tags: patch

It looks like a parenthesis was misplaced in the recent change to
c-ts-mode--anchor-prev-sibling causing an infinite loop during
indentation.

In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.41, cairo version 1.18.0) of 2024-10-14 built on noah-X580VD
Repository revision: 2a6f1527f6b3080c3879e6159424b824c86801a7
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101011
System Description: Ubuntu 24.04.1 LTS

Configured using:
 'configure --prefix=/usr/local --with-modules --with-tree-sitter
--with-threads --with-gnutls --with-mailutils --with-jpeg --with-png
--with-rsvg --with-tiff --with-xml2 --with-xpm --with-imagemagick
CC=gcc-13 CXX=gcc-13 CFLAGS= CXXFLAGS= PKG_CONFIG_PATH='
From cc34936efba46568505d8801dc335f8cec8f731e Mon Sep 17 00:00:00 2001
From: Noah Peart <[email-masked]>
Date: Tue, 15 Oct 2024 19:31:28 -0700
Subject: [PATCH] Fix misplaced paren in c-ts-mode--anchor-prev-sibling

* lisp/progmodes/c-ts-mode.el (c-ts-mode--anchor-prev-sibling):
Fix parentheses around condition.
---
 lisp/progmodes/c-ts-mode.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index 3f6a7422aa0..0d7f95e9a6d 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -343,8 +343,8 @@ c-ts-mode--anchor-prev-sibling
           ;; and starting the items on the same line as {.
           (_ (goto-char (treesit-node-start prev-sibling))
              (if (or (looking-back (rx bol (* whitespace))
-                                   (line-beginning-position)))
-                     (null (treesit-node-prev-sibling prev-sibling t))
+                                   (line-beginning-position))
+                     (null (treesit-node-prev-sibling prev-sibling t)))
                  (setq continue nil)
                (setq prev-sibling
                      (treesit-node-prev-sibling prev-sibling)))))))
-- 
2.43.0