From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juan Palacios Newsgroups: gmane.emacs.bugs Subject: bug#66845: 29.1; cmake-ts-mode indentation broken Date: Tue, 7 Nov 2023 21:11:37 +0100 Message-ID: References: <4m1KSu7eJ_B7nNCVOnvZM_edTrQhMTtxiKFwUB4zNoYufrWuTYcq_tL1iIRml2xqDRdTDavJBnE7B4iNmswVLwzGXI96E_FNcXkCeDqUzVo=@rjt.dev> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22152"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuan Fu , 66845@debbugs.gnu.org To: Randy Taylor Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 07 21:12:45 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r0SRJ-0005Zb-0m for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Nov 2023 21:12:45 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0SR0-0005xH-Tt; Tue, 07 Nov 2023 15:12:26 -0500 Original-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 1r0SQy-0005vC-Ut for bug-gnu-emacs@gnu.org; Tue, 07 Nov 2023 15:12:24 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0SQy-00006b-MX for bug-gnu-emacs@gnu.org; Tue, 07 Nov 2023 15:12:24 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r0SRa-0003mv-ED for bug-gnu-emacs@gnu.org; Tue, 07 Nov 2023 15:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juan Palacios Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Nov 2023 20:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66845 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66845-submit@debbugs.gnu.org id=B66845.169938793814507 (code B ref 66845); Tue, 07 Nov 2023 20:13:02 +0000 Original-Received: (at 66845) by debbugs.gnu.org; 7 Nov 2023 20:12:18 +0000 Original-Received: from localhost ([127.0.0.1]:43317 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0SQs-0003lu-6j for submit@debbugs.gnu.org; Tue, 07 Nov 2023 15:12:18 -0500 Original-Received: from mail-yb1-xb2b.google.com ([2607:f8b0:4864:20::b2b]:52285) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0SQq-0003li-Dm for 66845@debbugs.gnu.org; Tue, 07 Nov 2023 15:12:17 -0500 Original-Received: by mail-yb1-xb2b.google.com with SMTP id 3f1490d57ef6-da2e786743aso6330280276.0 for <66845@debbugs.gnu.org>; Tue, 07 Nov 2023 12:11:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699387892; x=1699992692; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=TJLDjYKVtfbugj1/va+vdWHZZ/yGxS+khnAdFc+7ep4=; b=maqmOs4Y7nL3zDTakl6osQB1+c1gnxHqN4sfxewKTyyr5gOLdGmjdBEF+uLqoNFjW2 pjGu3qyqaVmgK/UtZAg/1FPAnhYa8yh6rHhWV5yumpuOILkzA1eu0rLJCbLXzeB1A8hr WIjswmioqydEJDZCR179dvBP8Xubku5BV1wJc3v6ccSz0uxVGpoWPbLfoz/UWaBHMmQg b1pX/Oufcf6CKKfkRbG7hy23rL+O2XdA6Pm7qYnJDcb/s526CSf6QHwECMYULpiPGy57 2/Ra6fEI8Ospo/3jepgS1fSbOwTFmMb1ogeQJFjT7mZva+9sYxClxIko8fwwMd+Lu92C 880A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699387892; x=1699992692; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TJLDjYKVtfbugj1/va+vdWHZZ/yGxS+khnAdFc+7ep4=; b=POOCqBi8ILPMWCDIODUCUACxZjdSocj+iojBOM0X0Os0ydxT9Yex1CvHH4YUd23DcG qLg6Hh+Axud3MIOQRTfWxnbI8wNWlc443X9V/qKpZBQa+OQMLMKwZ4rL1AgPMNcjs8wV 4wQXuCxwT5n3h32NUD5n6b3uS0qU4NUGfQcmT6lgcM41fbplO2sAnUA0uvLWAUVFcAMH tO42HV6HdHVwT6TcUiaXref6QcKyt+1aVBrGPa1tfBQzahxbpzVQxtInrb1fRIvJ1Md7 CQr9bD6ZSbEasDjPn1wt+QyE6LETrM6b9++ULUfNvnhTF+MuHqgscGWXnpw8YYaA11AR TV0A== X-Gm-Message-State: AOJu0YySM9TcosSFRI29d0i7z9NTaysuMSHaJGkAdG1LiN+A2RXsuLqw 2kCKkNXdqhO6eqEvOQkPBwN5jjW+IIgltCRIvg== X-Google-Smtp-Source: AGHT+IGfr0Z55o7wKrv9fftjyKtquubk5UrbLe6FD4yIc5QWP1GGA3X1rMLyd/+24w5JrdiMDCNdiaErmRMvX8eS8oQ= X-Received: by 2002:a25:42c1:0:b0:da0:c9bc:5877 with SMTP id p184-20020a2542c1000000b00da0c9bc5877mr27181927yba.18.1699387892552; Tue, 07 Nov 2023 12:11:32 -0800 (PST) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:273947 Archived-At: El mar, 7 nov 2023 a las 18:22, Randy Taylor () escribi=C3=B3: > > On Tuesday, November 7th, 2023 at 03:25, Yuan Fu wrot= e: > > IMO it makes more sense to use prev-sibling: > > > > ,@(ignore-errors > > (treesit-query-capture 'cmake '((body) @capture)) > > `(((parent-is "body") prev-sibling 0))) > > > > This would allow users to manually adjust the indentation of a line and= have the rest of the body follow that. > > This would be much more elegant but unfortunately that and my previous pa= tch failed to account for the following: > > 1 if(TRUE) # Comment. > 2 endif() > > And place POINT at the end of line 1 and hit RET. It will indent to the s= tart of the comment :(. However, you gave me an idea: use the grand-parent = as the anchor (which in this case is the if - exactly what we want). I've a= ttached a new patch which accounts for that. > > Juan, thanks for testing the first patch. Please give this new one a whir= l if you're able to. This patch is working fine. Thank you!