From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 24 04:15:35 2024 Received: (at submit) by debbugs.gnu.org; 24 Nov 2024 09:15:35 +0000 Received: from localhost ([127.0.0.1]:32841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tF8iN-00005A-3H for submit@debbugs.gnu.org; Sun, 24 Nov 2024 04:15:35 -0500 Received: from lists.gnu.org ([209.51.188.17]:47092) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tF8iK-00004y-EW for submit@debbugs.gnu.org; Sun, 24 Nov 2024 04:15:33 -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 1tF8iJ-0004oS-MV for bug-gnu-emacs@gnu.org; Sun, 24 Nov 2024 04:15:32 -0500 Received: from mx.kolabnow.com ([212.103.80.155]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tF8iH-0002GU-Cs for bug-gnu-emacs@gnu.org; Sun, 24 Nov 2024 04:15:31 -0500 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id 3A5BC3005A03 for ; Sun, 24 Nov 2024 10:15:21 +0100 (CET) Authentication-Results: ext-mx-out013.mykolab.com (amavis); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-type:content-type:mime-version:message-id:date:date :subject:subject:from:from:received:received:received; s= dkim20240523; t=1732439719; x=1734254120; bh=sfwjHTu+j2xs3NK9Zb/ 1FrT5hCr1vNW+c1BqosFFBxc=; b=Q8+6coCk0XnszA1Mt1wsmXz3pNSupGCuvcr +WScaXTfeIvTWtN28jGSgZbToB3ESqUFfHZjQ25Iv8WX+9udpLE8fBC8VFDIOQbW DxLu9U3AriHGVTztOdhwX0Wxyxjc+T37GDVxzX+ZsH4ovro18+hcRFsnkv0ACRz2 kTyY2UZQbUZs1wTNzlZ4OyN8JSAvn0SOSAMA1/vejp1yD7+4yQWGMGF+QXqtWQKk 4GXlFsukIND7gOlJfnFVBGMEFNmEBFqM35XrcttGD5D1yqkZMM0HYeW+kEIxWBic 5Z6NsCLblhLNtfW8CC+94SQHvWylCp6owH8D6un2XwfXNZINuxg== X-Virus-Scanned: amavis at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-10 required=5 tests=[ALL_TRUSTED=-1] autolearn=ham autolearn_force=no Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out013.mykolab.com [127.0.0.1]) (amavis, port 10024) with ESMTP id cl0O8QxCORek for ; Sun, 24 Nov 2024 10:15:19 +0100 (CET) Received: from int-mx009.mykolab.com (unknown [10.9.13.9]) by mx.kolabnow.com (Postfix) with ESMTPS id 229AF30005A1 for ; Sun, 24 Nov 2024 10:15:17 +0100 (CET) Received: from ext-subm010.mykolab.com (unknown [10.9.6.10]) by int-mx009.mykolab.com (Postfix) with ESMTPS id A77DB227A322 for ; Sun, 24 Nov 2024 10:15:17 +0100 (CET) From: =?utf-8?Q?J=C3=B8rgen_Kvalsvik?= To: bug-gnu-emacs@gnu.org Subject: [PATCH] Indent compounds c-ts-mode when { is not BOL X-Debbugs-CC: theo@thornhill.no,casouri@gmail.com Date: Sun, 24 Nov 2024 10:15:12 +0100 Message-ID: <87r071yov3.fsf@lambda.is> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=212.103.80.155; envelope-from=j@lambda.is; helo=mx.kolabnow.com 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) 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: -2.4 (--) --=-=-= Content-Type: text/plain Tags: patch Tags: patch I found that the coumpounded statements are anchored to the wrong object when 1. the compound is not at beginning-of-line and 2. it is not preceeded by a construct such as fndecl/for/if/while/etc., which differs from how c-mode indents it. Non-BOL compound statements is actually quite common with macros and testing frameworks (see the test case). For example, you want this to indent: TEST_CASE(1) { assert (...); } The heuristic is quite course - it simply checks if the grandparent is function-definition or not, which is really if this node is a top-level sibling in the function body. If that is the case, the old rules should apply and standalone-parent should be the guide; otherwise, it should be the parent-BOL. This feels a bit shaky but does seem to work well for the test cases, and can be refined in the future. --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Indent-compounds-c-ts-mode-when-is-not-BOL.patch >From ad5c50851710711fa1d62708633d7bae92f82fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Kvalsvik?= Date: Tue, 19 Nov 2024 08:01:01 +0100 Subject: [PATCH] Indent compounds c-ts-mode when { is not BOL Properly indent the body of compound expressions, even when then compound expression is not at the beginning of line and the parent is not an if/for/while/etc., and matches the behavior of c-mode. This fixes a problem that is common with macros and in testing frameworks. For example, you expect this to indent: TEST_CASE(1) { assert (...); } If the compound statement is the function body itself, don't apply this new rule and instead guide by the parent and first sibling. I'm sure there are subtle interactions that aren't handled properly by checking for "function_definition" rather than something more general, but it does fix the test case and the check can be improved as more cases are found. * lisp/progmodes/c-ts-mode.el (c-ts-mode--parent-is-not-top-compound): New function. (c-ts-mode--indent-styles): Use it. * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New compound statement test. --- lisp/progmodes/c-ts-mode.el | 8 +++++ .../progmodes/c-ts-mode-resources/indent.erts | 30 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 3823c553fda..80233e90241 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -402,6 +402,11 @@ c-ts-mode--first-sibling (treesit-node-start parent) (line-end-position)))))) +(defun c-ts-mode--parent-is-not-top-compound (_n parent &rest _) + "Matches when PARENT is not the top level compound statement, +the {} that immediately follows the signature." + (not (equal "function_definition" (treesit-node-type (treesit-node-parent parent))))) + (defun c-ts-mode--indent-styles (mode) "Indent rules supported by `c-ts-mode'. MODE is either `c' or `cpp'." @@ -478,6 +483,7 @@ c-ts-mode--indent-styles ;; Closing bracket. This should be before initializer_list ;; (and probably others) rule because that rule (and other ;; similar rules) will match the closing bracket. (Bug#61398) + ((and (node-is "}") c-ts-mode--parent-is-not-top-compound) parent-bol 0) ((node-is "}") standalone-parent 0) ,@(when (eq mode 'cpp) '(((node-is "access_specifier") parent-bol 0) @@ -497,6 +503,8 @@ c-ts-mode--indent-styles ((parent-is "field_declaration_list") c-ts-mode--anchor-prev-sibling 0) ;; Statement in {} blocks. + ((and (parent-is "compound_statement") c-ts-mode--parent-is-not-top-compound) + parent-bol c-ts-mode-indent-offset) ((or (and (parent-is "compound_statement") ;; If the previous sibling(s) are not on their ;; own line, indent as if this node is the first diff --git a/test/lisp/progmodes/c-ts-mode-resources/indent.erts b/test/lisp/progmodes/c-ts-mode-resources/indent.erts index 2f3540c3970..61e61677ed7 100644 --- a/test/lisp/progmodes/c-ts-mode-resources/indent.erts +++ b/test/lisp/progmodes/c-ts-mode-resources/indent.erts @@ -223,6 +223,36 @@ make_pair(int long_identifier_a[], int long_identifier_b[], =-=-= +Name: Compound Statement after code + +=-= +#define IOTA(var, n) for (int var = 0; var != (n); ++var) +int main() +{ +IOTA (v, 10) { +printf("%d ", v); +} + +const char *msg = "Hello, world!"; { +puts("Hello, world!"); +} +} + +=-= +#define IOTA(var, n) for (int var = 0; var != (n); ++var) +int main() +{ + IOTA (v, 10) { + printf("%d ", v); + } + + const char *msg = "Hello, world!"; { + puts("Hello, world!"); + } +} + +=-=-= + Name: Switch-Case statement =-= -- 2.39.5 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 28 23:57:41 2024 Received: (at 74507) by debbugs.gnu.org; 29 Nov 2024 04:57:41 +0000 Received: from localhost ([127.0.0.1]:40574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGt4X-00085N-8G for submit@debbugs.gnu.org; Thu, 28 Nov 2024 23:57:41 -0500 Received: from mail-pl1-f172.google.com ([209.85.214.172]:59712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGt4V-00085D-AC for 74507@debbugs.gnu.org; Thu, 28 Nov 2024 23:57:40 -0500 Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-21532055aebso7504555ad.3 for <74507@debbugs.gnu.org>; Thu, 28 Nov 2024 20:57:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732856199; x=1733460999; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=FcUaQnB+Yqnbra64uIlakx9lAqWGP9Mva3KL1MBt3Ss=; b=KvfuxRhk/V7olSxe4IaBMFCuI83Upd1t0RXLTTw3PzEKRgvYl+1j2hKJ7pKf5xyGfo S980zmOCyqEg877bdT/NEkArvOygfdRJSn7AUHu9Cn0sI57d3fSRddt5Lxu0WftHUYbF AtxFyj72yi3C7uhiamYd7I7f2H/4iMTOjLNhcD0vpHvo5xJAEw4aDdMoG+ajM7TfmgeE JSQakdAAi35HofOckvoMTRDCm18lVbLeCjKXC97CJpWXz15vTJyklSHihU5i12uMKiW8 9EPf9pDVZYrzeh6ZyEWmG9O54ZpgyggXDlzKCKP+2+snXQ4gXozy9VOg2BeqNeTa5jIW 2koQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732856199; x=1733460999; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FcUaQnB+Yqnbra64uIlakx9lAqWGP9Mva3KL1MBt3Ss=; b=e/YO5jIJSaFDXm6nWWIih98+YOqmUDVWuDagxq8LFhSaIr2tPVigwMDvgyS10sn5FU HOLzECcxCHoozouHXk7sPoIMiQa61Kk0hjA/0d77//D5zzBa6vR2tXrJz8WChHJBFAxl Ami5TUHkrj6Vgwg7yBdzqiweDQ/lV2ykMgAP0mvKbmEDPsO89YdLAZaSp5F4zPQV0Ois xr6Z6DP2P3CrZ4CgQQ/5l9ukVcBtTA5QEDe8oe5wUAAg+fnZ6ulxCkIO81FSdkYXV44g oD+803LqJcUe8Nlo5yoiSfKiJGUA7GoZatU4Cw/RK8ady712acNyrX1gipgQ65dM/ZSL /U9w== X-Gm-Message-State: AOJu0Yxs2pdYwKk0fZEqXoYisdPj5nUsD23EdTvZLhfHDhuDhQEi/Rtf lM5KAjQxrIBALU5tOxf40t1CUHRUpAtHrdWxEwkdaYCS/ENjNAj/3UGZOw== X-Gm-Gg: ASbGncsWlPFdJi6Rp5JeshUwgIcHYPBBbV5oyiivdCBGJLPoO1IFs5q1axw8h2C+I60 RpH9TIH3e6y7NvGfEZj23THSRNrFWN+AxT9XnHZ9nagb+k6P1RlS7gQHQg+JBCmbns4kwIQCy6n kWECFw7e1+DsnlZhnqFgCGxOsjdiTsXyroaqMZBZfE00qOPRPTTukFxx98TCTxRlMMFMXeZa4bS WUHebdOUyvvAAHiwkTOhsruJh1wEQZSmUO9peti7cH7977sIM/jsQtYZZGYm1lqJT0ewtyg2g== X-Google-Smtp-Source: AGHT+IHfrD2OUHVbCncb6KNWA4fvqqgW3ALRfsrrue6DzMl9vzwSJhZszdmeEYViokhed1OCjK0CDg== X-Received: by 2002:a17:902:f54a:b0:215:4362:bc76 with SMTP id d9443c01a7336-2154362bf24mr14974545ad.54.1732856198630; Thu, 28 Nov 2024 20:56:38 -0800 (PST) Received: from smtpclient.apple ([2601:646:8f81:6120:c885:af5e:9679:e419]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-215219ac205sm22088735ad.235.2024.11.28.20.56.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Nov 2024 20:56:37 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: bug#74507: [PATCH] Indent compounds c-ts-mode when { is not BOL From: Yuan Fu In-Reply-To: <87r071yov3.fsf@lambda.is> Date: Thu, 28 Nov 2024 20:56:26 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <66722213-91AB-45C1-BD99-2BF823485E63@gmail.com> References: <87r071yov3.fsf@lambda.is> To: =?utf-8?Q?J=C3=B8rgen_Kvalsvik?= X-Mailer: Apple Mail (2.3776.700.51) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74507 Cc: theo@thornhill.no, 74507@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 (-) > On Nov 24, 2024, at 1:15=E2=80=AFAM, J=C3=B8rgen Kvalsvik = wrote: >=20 > Tags: patch >=20 > Tags: patch >=20 >=20 > I found that the coumpounded statements are anchored to the wrong = object > when 1. the compound is not at beginning-of-line and 2. it is not > preceeded by a construct such as fndecl/for/if/while/etc., which = differs > from how c-mode indents it. >=20 > Non-BOL compound statements is actually quite common with macros and > testing frameworks (see the test case). For example, you want this to > indent: >=20 > TEST_CASE(1) { > assert (...); > } >=20 > The heuristic is quite course - it simply checks if the grandparent is > function-definition or not, which is really if this node is a = top-level > sibling in the function body. If that is the case, the old rules = should > apply and standalone-parent should be the guide; otherwise, it should = be > the parent-BOL. This feels a bit shaky but does seem to work well for > the test cases, and can be refined in the future. >=20 > <0001-Indent-compounds-c-ts-mode-when-is-not-BOL.patch> Thank you very much! Especially for the test case ;-) What=E2=80=99s the = progress of your copyright assignment? Has it completed? I=E2=80=99m working on refactoring the indentation rules for c-ts-mode. = Let me see if I can integrate this situation into the new rules I=E2=80=99= m writing. Yuan= From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 29 02:55:43 2024 Received: (at 74507) by debbugs.gnu.org; 29 Nov 2024 07:55:43 +0000 Received: from localhost ([127.0.0.1]:40806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGvqp-0000YI-Ey for submit@debbugs.gnu.org; Fri, 29 Nov 2024 02:55:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44390) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGvqm-0000Xy-Hy for 74507@debbugs.gnu.org; Fri, 29 Nov 2024 02:55:41 -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 1tGvqe-0000HR-Lp; Fri, 29 Nov 2024 02:55: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:References:Subject:In-Reply-To:To:From: Date; bh=6OYXQtncjV5OO0bJ/k0ZmqS0LPMApp62Y1zK4ne2Iag=; b=OqU5Odbi8SLQkFo2Z88H 0m5EUL1183x6ibnY+ewOpxHC7QtdYj7KAgOA1kOvPOA7xsBcMCMNqCuv97o5vyyuxWab0KXPN+zOS GoXJaJMV3489VDweoaz23JlJWnA4pYEl3NLoCmBtVN2LYEBoyiQCM6M6su1BxTxhvxTRs7GZeWs/Q UEaCPIhpkgnbCesZ9fOAq0Npdjrpu2/tPOGdczD74yeP342EPCvBmohysGmgIdhVV0Yuyx011CSIE /q0Rx/plUdQDCM8XgZoxgDvvrCSIFvqWmd9QWtQI3I8EA33KzC0+Dvp40iNgvPtlKC47OxtlZNfuF Tw8fw7CQz48y2g==; Date: Fri, 29 Nov 2024 09:54:56 +0200 Message-Id: <86ttbqbhkf.fsf@gnu.org> From: Eli Zaretskii To: Yuan Fu In-Reply-To: <66722213-91AB-45C1-BD99-2BF823485E63@gmail.com> (message from Yuan Fu on Thu, 28 Nov 2024 20:56:26 -0800) Subject: Re: bug#74507: [PATCH] Indent compounds c-ts-mode when { is not BOL References: <87r071yov3.fsf@lambda.is> <66722213-91AB-45C1-BD99-2BF823485E63@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74507 Cc: theo@thornhill.no, j@lambda.is, 74507@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 (---) > Cc: theo@thornhill.no, 74507@debbugs.gnu.org > From: Yuan Fu > Date: Thu, 28 Nov 2024 20:56:26 -0800 > > Thank you very much! Especially for the test case ;-) What’s the progress of your copyright assignment? Has it completed? Jørgen's assignment is on file, so we are good in that department. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 29 02:57:32 2024 Received: (at 74507) by debbugs.gnu.org; 29 Nov 2024 07:57:32 +0000 Received: from localhost ([127.0.0.1]:40816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGvsa-0000cL-At for submit@debbugs.gnu.org; Fri, 29 Nov 2024 02:57:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56316) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGvsY-0000c7-HQ for 74507@debbugs.gnu.org; Fri, 29 Nov 2024 02:57: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 1tGvsT-0000oC-2o; Fri, 29 Nov 2024 02:57:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=vBplX7uOvPPWzHq03o5SDbUlhbUI7ibGtT3dZYbnHNU=; b=q+PA/vrt39K8zO8NtqOP ryt5YA8QOavLCmQFKWF+r8QGzPQIm8AVwL9YcVcLE+AmA6/2Z6u0SYi422UuOgiTxaJILcWI5jFEx vkjRNxOrb58LznpFBU6Rr/ToxGkjsyivAHthFxUvZfGUB8smvdqK9p4ylHJnyrYbH5waMlPPwMHFO 5WZ9T1AHZp/P6S1KKawLFXwfG9KD59Zjl64S0K0E0Hj9vq4u5uTMVAEWRsHSmF2/gx0HBkJhcunzC 6CUIr3GsOCwe4uJF2gODQ2oZUSg7rUsJJfgOF42zmiTRdqQ1bM5oArdPjq8syRQg/bfWBh77ZeXWg MjEbfIBI9FlZng==; Date: Fri, 29 Nov 2024 09:57:03 +0200 Message-Id: <86serabhgw.fsf@gnu.org> From: Eli Zaretskii To: =?iso-8859-1?Q?J=F8rgen?= Kvalsvik In-Reply-To: <87r071yov3.fsf@lambda.is> (message from =?iso-8859-1?Q?J=F8r?= =?iso-8859-1?Q?gen?= Kvalsvik on Sun, 24 Nov 2024 10:15:12 +0100) Subject: Re: bug#74507: [PATCH] Indent compounds c-ts-mode when { is not BOL References: <87r071yov3.fsf@lambda.is> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74507 Cc: casouri@gmail.com, theo@thornhill.no, 74507@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 (---) > Cc: theo@thornhill.no,casouri@gmail.com > From: Jørgen Kvalsvik > Date: Sun, 24 Nov 2024 10:15:12 +0100 > > * lisp/progmodes/c-ts-mode.el (c-ts-mode--parent-is-not-top-compound): > New function. > (c-ts-mode--indent-styles): Use it. > * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New compound > statement test. Please make sure the lines here are not too long (see CONTRIBUTE for details). > +(defun c-ts-mode--parent-is-not-top-compound (_n parent &rest _) > + "Matches when PARENT is not the top level compound statement, > +the {} that immediately follows the signature." The first line of a doc string should be a single complete sentence. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 29 04:04:50 2024 Received: (at 74507) by debbugs.gnu.org; 29 Nov 2024 09:04:50 +0000 Received: from localhost ([127.0.0.1]:40920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGwvi-0003uy-Gf for submit@debbugs.gnu.org; Fri, 29 Nov 2024 04:04:50 -0500 Received: from mx.kolabnow.com ([212.103.80.154]:47786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGwvf-0003ue-J5 for 74507@debbugs.gnu.org; Fri, 29 Nov 2024 04:04:48 -0500 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id 30C603069ABC; Fri, 29 Nov 2024 10:04:41 +0100 (CET) Authentication-Results: ext-mx-out013.mykolab.com (amavis); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:content-language:references:subject:subject :mime-version:date:date:message-id:received:received:received; s=dkim20240523; t=1732871080; x=1734685481; bh=zy8cnkrwnssK8mNh qJSRHHk8yHIP3in0PVOpvUQfvUM=; b=UDiui5VAQA/KTDedTdXke9twzxNdeWiw 97rjRzdBiJzHyh9Z3wXrjLboAs+a00NctEJHvzt+5yiREC7qqO/pNtSIoL3Qaa0x 2EauNEIftiKk2dVWVTw/AQpE+5jKs+GuaJeAZAwk+VyiHFQa3hfr2iMbzF8h5mBe zIJNoUFKBbA/RSh2dpa1GlU2/3zx18sj6WAGq/37uiuqwGsd58WmSwio0vLfPW10 uLFNGqZLi1vmR9atCF+am5ZFMBpbNBsaNemDX6E+fwAT8JH9luAAXXa4DmYyS64x Ff4WdICzDIgMshem/Xn4m6gSWlB+S4RFAX+1T5mE8mOCYMbfOFT2HQ== X-Virus-Scanned: amavis at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-10 required=5 tests=[ALL_TRUSTED=-1] autolearn=ham autolearn_force=no Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out013.mykolab.com [127.0.0.1]) (amavis, port 10024) with ESMTP id XmabUwHwZxQ9; Fri, 29 Nov 2024 10:04:40 +0100 (CET) Received: from int-mx009.mykolab.com (unknown [10.9.13.9]) by mx.kolabnow.com (Postfix) with ESMTPS id E73E63069AB9; Fri, 29 Nov 2024 10:04:38 +0100 (CET) Received: from ext-subm010.mykolab.com (unknown [10.9.6.10]) by int-mx009.mykolab.com (Postfix) with ESMTPS id 79FAA24CD962; Fri, 29 Nov 2024 10:04:38 +0100 (CET) Message-ID: <6f6fbda2-ce84-4f85-8727-9d652473c6cb@lambda.is> Date: Fri, 29 Nov 2024 10:04:36 +0100 MIME-Version: 1.0 Subject: Re: bug#74507: [PATCH] Indent compounds c-ts-mode when { is not BOL To: Yuan Fu References: <87r071yov3.fsf@lambda.is> <66722213-91AB-45C1-BD99-2BF823485E63@gmail.com> Content-Language: en-US From: =?UTF-8?Q?J=C3=B8rgen_Kvalsvik?= In-Reply-To: <66722213-91AB-45C1-BD99-2BF823485E63@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74507 Cc: theo@thornhill.no, 74507@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 (-) On 11/29/24 05:56, Yuan Fu wrote: > > >> On Nov 24, 2024, at 1:15 AM, Jørgen Kvalsvik wrote: >> >> Tags: patch >> >> Tags: patch >> >> >> I found that the coumpounded statements are anchored to the wrong object >> when 1. the compound is not at beginning-of-line and 2. it is not >> preceeded by a construct such as fndecl/for/if/while/etc., which differs >> from how c-mode indents it. >> >> Non-BOL compound statements is actually quite common with macros and >> testing frameworks (see the test case). For example, you want this to >> indent: >> >> TEST_CASE(1) { >> assert (...); >> } >> >> The heuristic is quite course - it simply checks if the grandparent is >> function-definition or not, which is really if this node is a top-level >> sibling in the function body. If that is the case, the old rules should >> apply and standalone-parent should be the guide; otherwise, it should be >> the parent-BOL. This feels a bit shaky but does seem to work well for >> the test cases, and can be refined in the future. >> >> <0001-Indent-compounds-c-ts-mode-when-is-not-BOL.patch> > > Thank you very much! Especially for the test case ;-) What’s the progress of your copyright assignment? Has it completed? As Eli says, I have submitted the paperwork. > > I’m working on refactoring the indentation rules for c-ts-mode. Let me see if I can integrate this situation into the new rules I’m writing. > > Yuan Splendid, thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 29 04:05:23 2024 Received: (at 74507) by debbugs.gnu.org; 29 Nov 2024 09:05:23 +0000 Received: from localhost ([127.0.0.1]:40927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGwwE-000423-TT for submit@debbugs.gnu.org; Fri, 29 Nov 2024 04:05:23 -0500 Received: from mx.kolabnow.com ([212.103.80.154]:44116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGwwC-00041h-2G for 74507@debbugs.gnu.org; Fri, 29 Nov 2024 04:05:21 -0500 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id B114E20B366F; Fri, 29 Nov 2024 10:05:14 +0100 (CET) Authentication-Results: ext-mx-out011.mykolab.com (amavis); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:content-language:references:subject:subject :mime-version:date:date:message-id:received:received:received; s=dkim20240523; t=1732871114; x=1734685515; bh=gE7IUm2aFNv3DldQ FAjyTGHAUiYh7MP2ZxbY/5FyKGE=; b=QURigYWUkpAbv/wd3Whpfu7RHgE4rE9z fAWJe5r4G0FjQ12aFcSy/tkX8IWKLl7vT03QNzHFCK0NnJnk/fJCZQ5EPzoC+fbf NsyPJIkxEdT5dMWhgNC3SRzxQO/O54huwYTPVKxGzhT6TWRC70TgVMcWMkv4erIi O8z/dv/WJaPAQhCGI/jD5tMKCyXvQxHkyfwhSX+jB/FYsMjh/gTKtptNTuALTyb9 jTb4u1sqE3n74ARebdLCDmiDSddRzTSog4WYlfFKyTnUHZucqZ15pof7uNzEjg/5 JRcikZNKN7y3K/lZg/YMxy/oEvr/r/PCqZw4CnGlX0c21dM9kGo5DQ== X-Virus-Scanned: amavis at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-10 required=5 tests=[ALL_TRUSTED=-1] autolearn=ham autolearn_force=no Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out011.mykolab.com [127.0.0.1]) (amavis, port 10024) with ESMTP id htkFvO-av9qj; Fri, 29 Nov 2024 10:05:14 +0100 (CET) Received: from int-mx009.mykolab.com (unknown [10.9.13.9]) by mx.kolabnow.com (Postfix) with ESMTPS id 1344820B3663; Fri, 29 Nov 2024 10:05:12 +0100 (CET) Received: from ext-subm010.mykolab.com (unknown [10.9.6.10]) by int-mx009.mykolab.com (Postfix) with ESMTPS id D09E324CD967; Fri, 29 Nov 2024 10:05:12 +0100 (CET) Message-ID: <1e4fcc9a-4f69-4c3a-b9d6-716d61129e31@lambda.is> Date: Fri, 29 Nov 2024 10:05:11 +0100 MIME-Version: 1.0 Subject: Re: bug#74507: [PATCH] Indent compounds c-ts-mode when { is not BOL To: Eli Zaretskii References: <87r071yov3.fsf@lambda.is> <86serabhgw.fsf@gnu.org> Content-Language: en-US From: =?UTF-8?Q?J=C3=B8rgen_Kvalsvik?= In-Reply-To: <86serabhgw.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74507 Cc: casouri@gmail.com, theo@thornhill.no, 74507@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 (-) On 11/29/24 08:57, Eli Zaretskii wrote: >> Cc: theo@thornhill.no,casouri@gmail.com >> From: Jørgen Kvalsvik >> Date: Sun, 24 Nov 2024 10:15:12 +0100 >> >> * lisp/progmodes/c-ts-mode.el (c-ts-mode--parent-is-not-top-compound): >> New function. >> (c-ts-mode--indent-styles): Use it. >> * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New compound >> statement test. > > Please make sure the lines here are not too long (see CONTRIBUTE for > details). > >> +(defun c-ts-mode--parent-is-not-top-compound (_n parent &rest _) >> + "Matches when PARENT is not the top level compound statement, >> +the {} that immediately follows the signature." > > The first line of a doc string should be a single complete sentence. > > Thanks. Ok. Yuan, would you like me to submit a revision? From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 29 19:17:19 2024 Received: (at 74507) by debbugs.gnu.org; 30 Nov 2024 00:17:19 +0000 Received: from localhost ([127.0.0.1]:44820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHBAl-0001up-3P for submit@debbugs.gnu.org; Fri, 29 Nov 2024 19:17:19 -0500 Received: from mail-pg1-f182.google.com ([209.85.215.182]:43470) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHBAh-0001uX-Ki for 74507@debbugs.gnu.org; Fri, 29 Nov 2024 19:17:17 -0500 Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-7fc8f0598cdso2332038a12.1 for <74507@debbugs.gnu.org>; Fri, 29 Nov 2024 16:17:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732925774; x=1733530574; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DzHMkd17Qs+Qg0Z7pDJ2ZU3yX3hnqh4pBKWJBCK1j7c=; b=JWsUnOFRwS/9C2XUyEkQOXFlyatvB/jMrmXdaD0i+zCggPcmtK1rHEH1z1K/XzQoUB G9zeu2A9il7uzb6rpZBJsYqHNkub8LwTXO6Bkp15k1fYq2L9uheyUfws/rs+en8zMYA+ gMugktZRkSu7qTrlBv4CvHUgU2j2mcDKSljpCGNoUuJUHOBCwvLHbUPYLTjeoBQovrhY nO7Fy8sq252MMXl6CPSfL56b/HwC8cY8kuEJcsoFCg/DDCILoCPrR72rcGrEJF+JKG7p QqTH6AETV56XbO4WxYg9ijJjMPcadhWpwOyzmju+pyUpVy6DTQd7HW3MF+TTbb4Oex4B DcGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732925774; x=1733530574; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DzHMkd17Qs+Qg0Z7pDJ2ZU3yX3hnqh4pBKWJBCK1j7c=; b=gQX3tnnj3MgRGiQu1kIuR1bR1YKd8dJyOiGJ276JsvNrQGWiQfhjpQE7j4iDfMLBS7 1HQ8bmvFLi56Ci33mHoGLIrl294lq2RABVo4jksMAUI5iTAE7lLHB7gbpEwWY6f5CwKU g0DYo1A0WIvL5GmrFnS+lDPNmHXB4yiEB895YVhjMx1MfUK5beqnLlXkAduMExUJULWQ VlLkH20+49UUfcl335oZ2UI+wT96+Orw6guSwEcgXVbq3VqpvZ1ZnAQzlut8qwOUqqBt Ul5iSu/IryJzBbtHm3+RplHWzNKR+/aLuy+UEuKaZxcdBA3agpusonLwt3xBixPdOG2n cm9A== X-Forwarded-Encrypted: i=1; AJvYcCVBNgtySX+WAIqSVVpLLpYUFeRRHbIamf0ab3ruaqGe6xtVPtgobIjhkZzRxkQvWcz7YzuQKw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yxlc2OX3kAYisDmmYKE/DI50uS1MvTXsU7swS3cLuLp79mmma9D sNVvA4omDrptaoVR/wjnr3NIxOrohGt8QCxWoKd2bxCVTEbjEAoR X-Gm-Gg: ASbGnctMgHGzDIxrlrgg3jn3o6rhxgLBDePsyOes5GJns+lo0LWX8Ov4y91SwLoEzq6 veYLfdu5FQaRBi8nKPXDf9nKq3f3EcJ6m2WPhsgXtwfZN5vpzlGisB19tkOMPdoQ/hfeF/IR5N8 HKbqasczPCQ6dk4Z7rm3TyrsjdAfFIog6PPcV70mDgSWWD/iOEuYVCi+l43vJPEp+2avssCeTYG roLjXGm7qPX2M2kPmQ/XOrItFVcWr1Q6r17p4aUjmy72HTcQltQrHYBA7AN7BJZtrPkYKkEtg== X-Google-Smtp-Source: AGHT+IFg7ZvHFCl7jVCQJWsk19LIRAXgMyeeJBSW9xe64i9n0SxRA05mvFf9rbUUn9rnCH4nAIEqAQ== X-Received: by 2002:a05:6300:8083:b0:1e0:cc01:43da with SMTP id adf61e73a8af0-1e0ec449d2fmr12899710637.0.1732925774548; Fri, 29 Nov 2024 16:16:14 -0800 (PST) Received: from smtpclient.apple ([2601:646:8f81:6120:71b7:718f:7faa:8436]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72541761309sm4070743b3a.5.2024.11.29.16.16.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Nov 2024 16:16:13 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: bug#74507: [PATCH] Indent compounds c-ts-mode when { is not BOL From: Yuan Fu In-Reply-To: <1e4fcc9a-4f69-4c3a-b9d6-716d61129e31@lambda.is> Date: Fri, 29 Nov 2024 16:16:02 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <87r071yov3.fsf@lambda.is> <86serabhgw.fsf@gnu.org> <1e4fcc9a-4f69-4c3a-b9d6-716d61129e31@lambda.is> To: =?utf-8?Q?J=C3=B8rgen_Kvalsvik?= X-Mailer: Apple Mail (2.3776.700.51) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74507 Cc: Eli Zaretskii , theo@thornhill.no, 74507@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 (-) > On Nov 29, 2024, at 1:05=E2=80=AFAM, J=C3=B8rgen Kvalsvik = wrote: >=20 > On 11/29/24 08:57, Eli Zaretskii wrote: >>> Cc: theo@thornhill.no,casouri@gmail.com >>> From: J=C3=B8rgen Kvalsvik >>> Date: Sun, 24 Nov 2024 10:15:12 +0100 >>>=20 >>> * lisp/progmodes/c-ts-mode.el = (c-ts-mode--parent-is-not-top-compound): >>> New function. >>> (c-ts-mode--indent-styles): Use it. >>> * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New compound >>> statement test. >> Please make sure the lines here are not too long (see CONTRIBUTE for >> details). >>> +(defun c-ts-mode--parent-is-not-top-compound (_n parent &rest _) >>> + "Matches when PARENT is not the top level compound statement, >>> +the {} that immediately follows the signature." >> The first line of a doc string should be a single complete sentence. >> Thanks. >=20 > Ok. Yuan, would you like me to submit a revision? Since your assignment is already done, let=E2=80=99s just apply your = patch, and I=E2=80=99ll rebase my changes on top of yours. So yeah, do = send the revision patch, thanks! Yuan= From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 30 10:40:06 2024 Received: (at 74507) by debbugs.gnu.org; 30 Nov 2024 15:40:06 +0000 Received: from localhost ([127.0.0.1]:48328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHPZl-0000EH-Lp for submit@debbugs.gnu.org; Sat, 30 Nov 2024 10:40:06 -0500 Received: from mx.kolabnow.com ([212.103.80.154]:48298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHPZi-0000DL-ST for 74507@debbugs.gnu.org; Sat, 30 Nov 2024 10:40:03 -0500 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id B27C920B2764 for <74507@debbugs.gnu.org>; Sat, 30 Nov 2024 16:39:56 +0100 (CET) Authentication-Results: ext-mx-out011.mykolab.com (amavis); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-type:content-type:mime-version:subject:subject:from:from :message-id:date:date:received:received:received; s= dkim20240523; t=1732981195; x=1734795596; bh=h0pykLEJoE1zd7tK9aO pOPdrpLyyFTfJzxGPN5QLl98=; b=a74Gw20xPLexjRbToDjrzPbTn8MPL8XH8ov K6ElKiUmJfDI3otg2pTfv2FhUOP836RAMtUHkwx41DhP2x8NbP2xJFemCYarsrjF gAVpo8JydwrrdCohvmvOPeKTNQfhjG61o6ZuxLFuMaEnHYvv4HBNFQv0CZouKWyL vrXGIEKGnf3lgR++sHNee8iR+GZH9Ov1sb764RmOGHFyHE0s0f+qgfiF8RG5Hdv4 Rni3doZx64YfOBhmd8MDQHxT1zUWa8+8OnJ2qb/tIjTwSyozS6mAPM2ZGtTPsUGp NPNSt0L4drglW3awLYbc/Il3NmPPCP6CKQOOlaBY/t59mR1wSQA== X-Virus-Scanned: amavis at mykolab.com X-Amavis-Alert: BAD HEADER SECTION, MIME error: error: unexpected end of header; ; error: part did not end with expected boundary; ; error: unexpected end of parts before epilogue X-Spam-Flag: NO X-Spam-Score: -0.999 X-Spam-Level: X-Spam-Status: No, score=-0.999 tagged_above=-10 required=5 tests=[ALL_TRUSTED=-1, MISSING_MIME_HB_SEP=0.001] autolearn=ham autolearn_force=no Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out011.mykolab.com [127.0.0.1]) (amavis, port 10024) with ESMTP id bJtd20KBCdN7 for <74507@debbugs.gnu.org>; Sat, 30 Nov 2024 16:39:55 +0100 (CET) Received: from int-mx009.mykolab.com (unknown [10.9.13.9]) by mx.kolabnow.com (Postfix) with ESMTPS id 6BCF220B274D for <74507@debbugs.gnu.org>; Sat, 30 Nov 2024 16:39:54 +0100 (CET) Received: from ext-subm010.mykolab.com (unknown [10.9.6.10]) by int-mx009.mykolab.com (Postfix) with ESMTPS id 1B139288545C for <74507@debbugs.gnu.org>; Sat, 30 Nov 2024 16:39:54 +0100 (CET) Date: Sat, 30 Nov 2024 16:39:48 +0100 Message-Id: <8734j8zq63.fsf@lambda.is> From: =?utf-8?Q?J=C3=B8rgen_Kvalsvik?= To: 74507@debbugs.gnu.org Subject: [PATCH] Indent compounds in c-ts-mode when { is not BOL MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74507 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; charset=utf-8 Content-Transfer-Encoding: quoted-printable Tags: patch Here you go. Thank you for the feedback, Eli. Thanks, J=C3=B8rgen =20 --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Indent-compounds-in-c-ts-mode-when-is-not-BOL.patch From: =?UTF-8?q?J=C3=B8rgen=20Kvalsvik?= Date: Tue, 19 Nov 2024 08:01:01 +0100 Subject: [PATCH] Indent compounds in c-ts-mode when { is not BOL Properly indent the body of compound expressions, even when then compound expression is not at the beginning of line and the parent is not an if/for/while/etc., and matches the behavior of c-mode. This fixes a problem that is common with macros and in testing frameworks. For example, you expect this to indent: TEST_CASE(1) { assert (...); } If the compound statement is the function body itself, don't apply this new rule and instead guide by the parent and first sibling. I'm sure there are subtle interactions that aren't handled properly by checking for "function_definition" rather than something more general, but it does fix the test case and the check can be improved as more cases are found. * lisp/progmodes/c-ts-mode.el: (c-ts-mode--parent-is-not-top-compound): New function. (c-ts-mode--indent-styles): Use it. * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New compound statement test. --- lisp/progmodes/c-ts-mode.el | 9 ++++++ .../progmodes/c-ts-mode-resources/indent.erts | 30 +++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 3823c553fda..b635e621b03 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -402,6 +402,12 @@ c-ts-mode--first-sibling (treesit-node-start parent) (line-end-position)))))) +(defun c-ts-mode--parent-is-not-top-compound (_n parent &rest _) + "Matches when PARENT is not the top level compound statement. +The top-level compound is the {} that immediately follows the function +signature." + (not (equal "function_definition" (treesit-node-type (treesit-node-parent parent))))) + (defun c-ts-mode--indent-styles (mode) "Indent rules supported by `c-ts-mode'. MODE is either `c' or `cpp'." @@ -478,6 +484,7 @@ c-ts-mode--indent-styles ;; Closing bracket. This should be before initializer_list ;; (and probably others) rule because that rule (and other ;; similar rules) will match the closing bracket. (Bug#61398) + ((and (node-is "}") c-ts-mode--parent-is-not-top-compound) parent-bol 0) ((node-is "}") standalone-parent 0) ,@(when (eq mode 'cpp) '(((node-is "access_specifier") parent-bol 0) @@ -497,6 +504,8 @@ c-ts-mode--indent-styles ((parent-is "field_declaration_list") c-ts-mode--anchor-prev-sibling 0) ;; Statement in {} blocks. + ((and (parent-is "compound_statement") c-ts-mode--parent-is-not-top-compound) + parent-bol c-ts-mode-indent-offset) ((or (and (parent-is "compound_statement") ;; If the previous sibling(s) are not on their ;; own line, indent as if this node is the first diff --git a/test/lisp/progmodes/c-ts-mode-resources/indent.erts b/test/lisp/progmodes/c-ts-mode-resources/indent.erts index 2f3540c3970..61e61677ed7 100644 --- a/test/lisp/progmodes/c-ts-mode-resources/indent.erts +++ b/test/lisp/progmodes/c-ts-mode-resources/indent.erts @@ -223,6 +223,36 @@ make_pair(int long_identifier_a[], int long_identifier_b[], =-=-= +Name: Compound Statement after code + +=-= +#define IOTA(var, n) for (int var = 0; var != (n); ++var) +int main() +{ +IOTA (v, 10) { +printf("%d ", v); +} + +const char *msg = "Hello, world!"; { +puts("Hello, world!"); +} +} + +=-= +#define IOTA(var, n) for (int var = 0; var != (n); ++var) +int main() +{ + IOTA (v, 10) { + printf("%d ", v); + } + + const char *msg = "Hello, world!"; { + puts("Hello, world!"); + } +} + +=-=-= + Name: Switch-Case statement =-= -- 2.39.5 --=-=-= Content-Type: text/plain Date: Sat, 30 Nov 2024 16:39:38 +0100 Message-ID: <874j3ozq6d.fsf@lambda.is> --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 30 15:49:58 2024 Received: (at 74507) by debbugs.gnu.org; 30 Nov 2024 20:49:58 +0000 Received: from localhost ([127.0.0.1]:49276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHUPe-0000Cf-5i for submit@debbugs.gnu.org; Sat, 30 Nov 2024 15:49:58 -0500 Received: from mx.kolabnow.com ([212.103.80.154]:41604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHUPc-0000CI-BZ for 74507@debbugs.gnu.org; Sat, 30 Nov 2024 15:49:57 -0500 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id 299EC30BDF0E; Sat, 30 Nov 2024 21:49:50 +0100 (CET) Authentication-Results: ext-mx-out013.mykolab.com (amavis); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:content-language:references:subject:subject :mime-version:date:date:message-id:received:received:received; s=dkim20240523; t=1732999789; x=1734814190; bh=00jDMESGlWBE69G8 FyhZcZB8kKYrbu2TW/gQzSuUstI=; b=or9n1hhI3OS2aDW5Un0MR8vEV2Gul0xY wqPDlGk3Vsx7eAYN6ZsUdNiFafSl5VXtnGfRQtzx7GCPRq7xzVXwfAKSrGBch8Uq omCc+q4rUCzk4BtpjiqIuYeRjH7pIYxCzTsJoMa6xMAyYmnP2AzVhwPqaoDWb22t c7UYekGodVr5k3RlZiA/g1tmE2MpsqcnKIvpqV3Az9bjadxlq+7K1C+GOmdAkCF4 0p8VR8mj5AYM19ucDo3+Dx1CRlqglF3E6rUKN1Xs0msCOUx6cgw+AIrQLrGLDF72 XfVOq/Pal9CBCEvlX7OwWlisUnLze33AsrpQRByFLukpLmVf5KxS1A== X-Virus-Scanned: amavis at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-10 required=5 tests=[ALL_TRUSTED=-1] autolearn=ham autolearn_force=no Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out013.mykolab.com [127.0.0.1]) (amavis, port 10024) with ESMTP id nYAXm9BV3YJF; Sat, 30 Nov 2024 21:49:49 +0100 (CET) Received: from int-mx009.mykolab.com (unknown [10.9.13.9]) by mx.kolabnow.com (Postfix) with ESMTPS id 2134F308C22E; Sat, 30 Nov 2024 21:49:48 +0100 (CET) Received: from ext-subm010.mykolab.com (unknown [10.9.6.10]) by int-mx009.mykolab.com (Postfix) with ESMTPS id EF25F239611D; Sat, 30 Nov 2024 21:49:47 +0100 (CET) Message-ID: Date: Sat, 30 Nov 2024 21:49:47 +0100 MIME-Version: 1.0 Subject: Re: bug#74507: [PATCH] Indent compounds c-ts-mode when { is not BOL To: Yuan Fu References: <87r071yov3.fsf@lambda.is> <86serabhgw.fsf@gnu.org> <1e4fcc9a-4f69-4c3a-b9d6-716d61129e31@lambda.is> Content-Language: en-US From: =?UTF-8?Q?J=C3=B8rgen_Kvalsvik?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74507 Cc: Eli Zaretskii , theo@thornhill.no, 74507@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 (-) On 11/30/24 01:16, Yuan Fu wrote: > > >> On Nov 29, 2024, at 1:05 AM, Jørgen Kvalsvik wrote: >> >> On 11/29/24 08:57, Eli Zaretskii wrote: >>>> Cc: theo@thornhill.no,casouri@gmail.com >>>> From: Jørgen Kvalsvik >>>> Date: Sun, 24 Nov 2024 10:15:12 +0100 >>>> >>>> * lisp/progmodes/c-ts-mode.el (c-ts-mode--parent-is-not-top-compound): >>>> New function. >>>> (c-ts-mode--indent-styles): Use it. >>>> * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New compound >>>> statement test. >>> Please make sure the lines here are not too long (see CONTRIBUTE for >>> details). >>>> +(defun c-ts-mode--parent-is-not-top-compound (_n parent &rest _) >>>> + "Matches when PARENT is not the top level compound statement, >>>> +the {} that immediately follows the signature." >>> The first line of a doc string should be a single complete sentence. >>> Thanks. >> >> Ok. Yuan, would you like me to submit a revision? > > Since your assignment is already done, let’s just apply your patch, and I’ll rebase my changes on top of yours. So yeah, do send the revision patch, thanks! > > Yuan Certainly - I posted it on the bug tracker. Thanks, Jørgen From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 01 04:27:14 2024 Received: (at 74507) by debbugs.gnu.org; 1 Dec 2024 09:27:14 +0000 Received: from localhost ([127.0.0.1]:50291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHgET-0005bJ-Nw for submit@debbugs.gnu.org; Sun, 01 Dec 2024 04:27:14 -0500 Received: from mail-pg1-f181.google.com ([209.85.215.181]:49155) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHgES-0005az-2l for 74507@debbugs.gnu.org; Sun, 01 Dec 2024 04:27:12 -0500 Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-7fbd70f79f2so3105622a12.2 for <74507@debbugs.gnu.org>; Sun, 01 Dec 2024 01:27:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733045166; x=1733649966; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YhVcq18xXaiXrxaGAxTQ8rrN2vBvjLpzHZ1IStLRCKA=; b=ZksxEIuB0aAVKIJknyYdUjrpRjB61V8F30k52/Kr/HNI0hrR5ThuhymqficK0FucUe MjSruHKRiYLNxjtNoUO/IHKxwFEnOlGaq4jNUknbCLTR0H7UjEjWjGMA5ZXJnoiYIAOc xPFzgOrbbSbgEuVX6r0w4Lm68gJgnu0XRv9dvrCfxNVf2oUgXY7MRbFwKmauoB2zcvOw TXIQSs32EUTv6056nY3cJJYRVJTgafdK5WVBLP7GcWOk3kWYaeexDRpy1dslmGwCRBNk UnIH/jF9H0NcPweDbFWkM4NmlusSUrb4zBh3P2aOyaqNW5xJlDnh+JCvdd2fzAM5I7Sm agKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733045166; x=1733649966; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YhVcq18xXaiXrxaGAxTQ8rrN2vBvjLpzHZ1IStLRCKA=; b=Ct2kqDKTHcwJizN1ouVDxLYGQSPAWfXxSUCqSqfpfdFYrT0BqeOILLZJJnUieu5aTO mF3IW9JPWuZoH/YVzamDFA8xKrg8Fp9bXlb36b3509yAyRYwlnnh0LVtZaiKyvpvW/kO KMy2gDz1f6a/wWAT3l1iMMlsm4NLu+3T7AmefK+QkDy6ttF0qt3Jtz51glDeWbIm2jfg ogzBlmO7NuoxN39AhquBXfsroioj+h8Ux/RkUAeqg6UfG5M5UvFnp5idHzGplGFdDHN8 vzf0Y/1XevjNKiodEw4/Q8F3B5I0c05I+NxoXeMTvQC+C1NQkvOdRT6vSrazPB/WOfUV UqJQ== X-Forwarded-Encrypted: i=1; AJvYcCWffXeAIACETpnewnj7oy/6K2DRqLXVuNKYqegfF6eZUzZ2ZCW4G4w7VON+52+r3ZczZJJC4w==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yx2xBc8eskD8BagBfPQqhFTTD5TGxro8fT2HrY10MiDVvdSqe1G pQA2GsPkrM3AtINRNEVudAIC2SjT1Nfv8d5Dcmor0Xln4dg5Ios4 X-Gm-Gg: ASbGncs/r2/8migqnozQK+08xxVlM91Mt8dMMKwvVyiGM9ji5DDfswWYZSwYAwWM43i RDNBCdl5kN4JGLVyMat9wPMMX0sjBJDlcUO7rajRs9bEcq6dxHhFYW8w6BuImMcW9k05FN1+k+l rb17jc1qu63tr8j9mJxXhnK2JEhWe3cAVpJiSxRJB4Mmixb/IqwamhCfyO6fQBh2Cplo6NuMx4q qw1vgrGx5vlLA/oP4V3HQsIwS/fdYhxcpG8RCw4irgyqENCAC9aJFvPJzwTs+IDVHbhvcwAXw== X-Google-Smtp-Source: AGHT+IHARLesImHN4jld7aqTW0TlAJcrzdVZ/mEuoxDN7WAFfzZqmL2OM2ShWWRviJDfRrpopm+sYA== X-Received: by 2002:a05:6a20:9f47:b0:1e1:384e:20f1 with SMTP id adf61e73a8af0-1e1384e2124mr10979742637.25.1733045165979; Sun, 01 Dec 2024 01:26:05 -0800 (PST) Received: from smtpclient.apple ([2601:646:8f81:6120:71b7:718f:7faa:8436]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7fc9c30c26dsm5779924a12.30.2024.12.01.01.26.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Dec 2024 01:26:05 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: bug#74507: [PATCH] Indent compounds c-ts-mode when { is not BOL From: Yuan Fu In-Reply-To: Date: Sun, 1 Dec 2024 01:25:53 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <60820855-5672-4083-B7B5-38FF5259BBF4@gmail.com> References: <87r071yov3.fsf@lambda.is> <86serabhgw.fsf@gnu.org> <1e4fcc9a-4f69-4c3a-b9d6-716d61129e31@lambda.is> To: =?utf-8?Q?J=C3=B8rgen_Kvalsvik?= X-Mailer: Apple Mail (2.3776.700.51) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74507 Cc: Eli Zaretskii , theo@thornhill.no, 74507@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 (-) > On Nov 30, 2024, at 12:49=E2=80=AFPM, J=C3=B8rgen Kvalsvik = wrote: >=20 > On 11/30/24 01:16, Yuan Fu wrote: >>> On Nov 29, 2024, at 1:05=E2=80=AFAM, J=C3=B8rgen Kvalsvik = wrote: >>>=20 >>> On 11/29/24 08:57, Eli Zaretskii wrote: >>>>> Cc: theo@thornhill.no,casouri@gmail.com >>>>> From: J=C3=B8rgen Kvalsvik >>>>> Date: Sun, 24 Nov 2024 10:15:12 +0100 >>>>>=20 >>>>> * lisp/progmodes/c-ts-mode.el = (c-ts-mode--parent-is-not-top-compound): >>>>> New function. >>>>> (c-ts-mode--indent-styles): Use it. >>>>> * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New = compound >>>>> statement test. >>>> Please make sure the lines here are not too long (see CONTRIBUTE = for >>>> details). >>>>> +(defun c-ts-mode--parent-is-not-top-compound (_n parent &rest _) >>>>> + "Matches when PARENT is not the top level compound statement, >>>>> +the {} that immediately follows the signature." >>>> The first line of a doc string should be a single complete = sentence. >>>> Thanks. >>>=20 >>> Ok. Yuan, would you like me to submit a revision? >> Since your assignment is already done, let=E2=80=99s just apply your = patch, and I=E2=80=99ll rebase my changes on top of yours. So yeah, do = send the revision patch, thanks! >> Yuan >=20 > Certainly - I posted it on the bug tracker. Thanks J=C3=B8rgen. What did you use to generate the patch? For some = reason I can=E2=80=99t apply it. My git skill isn=E2=80=99t that great = so it could be my problem. If you can apply it fine maybe you can share = the command you used? BTW, the commit title is missing. When you add the title, you can also = add the bug number. For example: Improve c-ts-mode indentation for macros (bug#74507) Yuan= From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 01 04:51:52 2024 Received: (at 74507) by debbugs.gnu.org; 1 Dec 2024 09:51:52 +0000 Received: from localhost ([127.0.0.1]:50316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHgcK-0006oF-6c for submit@debbugs.gnu.org; Sun, 01 Dec 2024 04:51:52 -0500 Received: from mx.kolabnow.com ([212.103.80.154]:58316) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHgcH-0006nz-CB for 74507@debbugs.gnu.org; Sun, 01 Dec 2024 04:51:51 -0500 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id CC8FD306C8B0; Sun, 1 Dec 2024 10:51:43 +0100 (CET) Authentication-Results: ext-mx-out013.mykolab.com (amavis); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= in-reply-to:from:from:content-language:references:subject :subject:mime-version:date:date:message-id:content-type :content-type:received:received:received; s=dkim20240523; t= 1733046701; x=1734861102; bh=Hwjk1AOa2WOBdexVaMAiNIXL3iB1n7jlbSv ZFT7BCMM=; b=bAUD6bsOYBaSSQQzt7qZiSQzgdQpbNLxfZBNmaa/qLgk7Y2DuOM HFYTL1GQYW6qzqYfDvXRYsm7x0vwDH+jsJvQMvsSISpVvBwVL3YxxMTpZQT2h9ZW RJyLbg2S8ATLX0UohVIsKiDZxgZK4xVFY9S+VyKvJsm3otwm+IPGeIcfDU8Z+M6N QKvmORufCcdIIEVbP/f39u9RhZic4LnVdgfEsaHv++hLj6ROCaR4fSYFTzpEQOXq 0OZ3ObJO99xCas5mdp+KYo1DD47pJdkShQA+H9pyChHDyI3J98iShoKpHl77MlEM lMMmritR5fF/DsM6E8+h7X9hQk5rczLj3pA== X-Virus-Scanned: amavis at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-10 required=5 tests=[ALL_TRUSTED=-1] autolearn=ham autolearn_force=no Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out013.mykolab.com [127.0.0.1]) (amavis, port 10024) with ESMTP id bfpvxzw2Lzxt; Sun, 1 Dec 2024 10:51:41 +0100 (CET) Received: from int-mx009.mykolab.com (unknown [10.9.13.9]) by mx.kolabnow.com (Postfix) with ESMTPS id C78003069ABC; Sun, 1 Dec 2024 10:51:39 +0100 (CET) Received: from ext-subm010.mykolab.com (unknown [10.9.6.10]) by int-mx009.mykolab.com (Postfix) with ESMTPS id 679F327F99C0; Sun, 1 Dec 2024 10:51:39 +0100 (CET) Content-Type: multipart/mixed; boundary="------------9qcD07ZIw5QZbEx7jLBAXrkr" Message-ID: <2b677735-ecc0-4fb6-be60-533bfbcc962a@lambda.is> Date: Sun, 1 Dec 2024 10:51:38 +0100 MIME-Version: 1.0 Subject: Re: bug#74507: [PATCH] Indent compounds c-ts-mode when { is not BOL To: Yuan Fu References: <87r071yov3.fsf@lambda.is> <86serabhgw.fsf@gnu.org> <1e4fcc9a-4f69-4c3a-b9d6-716d61129e31@lambda.is> <60820855-5672-4083-B7B5-38FF5259BBF4@gmail.com> Content-Language: en-US From: =?UTF-8?Q?J=C3=B8rgen_Kvalsvik?= In-Reply-To: <60820855-5672-4083-B7B5-38FF5259BBF4@gmail.com> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74507 Cc: Eli Zaretskii , theo@thornhill.no, 74507@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 (-) This is a multi-part message in MIME format. --------------9qcD07ZIw5QZbEx7jLBAXrkr Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 12/1/24 10:25, Yuan Fu wrote: > > >> On Nov 30, 2024, at 12:49 PM, Jørgen Kvalsvik wrote: >> >> On 11/30/24 01:16, Yuan Fu wrote: >>>> On Nov 29, 2024, at 1:05 AM, Jørgen Kvalsvik wrote: >>>> >>>> On 11/29/24 08:57, Eli Zaretskii wrote: >>>>>> Cc: theo@thornhill.no,casouri@gmail.com >>>>>> From: Jørgen Kvalsvik >>>>>> Date: Sun, 24 Nov 2024 10:15:12 +0100 >>>>>> >>>>>> * lisp/progmodes/c-ts-mode.el (c-ts-mode--parent-is-not-top-compound): >>>>>> New function. >>>>>> (c-ts-mode--indent-styles): Use it. >>>>>> * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New compound >>>>>> statement test. >>>>> Please make sure the lines here are not too long (see CONTRIBUTE for >>>>> details). >>>>>> +(defun c-ts-mode--parent-is-not-top-compound (_n parent &rest _) >>>>>> + "Matches when PARENT is not the top level compound statement, >>>>>> +the {} that immediately follows the signature." >>>>> The first line of a doc string should be a single complete sentence. >>>>> Thanks. >>>> >>>> Ok. Yuan, would you like me to submit a revision? >>> Since your assignment is already done, let’s just apply your patch, and I’ll rebase my changes on top of yours. So yeah, do send the revision patch, thanks! >>> Yuan >> >> Certainly - I posted it on the bug tracker. > > Thanks Jørgen. What did you use to generate the patch? For some reason I can’t apply it. My git skill isn’t that great so it could be my problem. If you can apply it fine maybe you can share the command you used? I used git format-patch HEAD~1, and I just tested applying it to master with `git am 0001-Indent-compounds-in-c-ts-mode-when-is-not-BOL.patch' which worked. > > BTW, the commit title is missing. When you add the title, you can also add the bug number. For example: > > Improve c-ts-mode indentation for macros (bug#74507) > > Yuan Sure. I've attached a new patch with the bug in it. I tested it and it applies cleanly with `git am 0001-Improve-c-ts-mode-compound-indents-bug-74507.patch' --------------9qcD07ZIw5QZbEx7jLBAXrkr Content-Type: text/x-patch; charset=UTF-8; name="0001-Improve-c-ts-mode-compound-indents-bug-74507.patch" Content-Disposition: attachment; filename="0001-Improve-c-ts-mode-compound-indents-bug-74507.patch" Content-Transfer-Encoding: base64 RnJvbSBhNmFmODUyOThkZTk5Y2RiZmM3OGM5NTY1OTIyNGM5ZGQ3ZTZhNGMxIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiA9P1VURi04P3E/Sj1DMz1COHJnZW49MjBLdmFsc3Zp az89IDxqQGxhbWJkYS5pcz4KRGF0ZTogVHVlLCAxOSBOb3YgMjAyNCAwODowMTowMSArMDEw MApTdWJqZWN0OiBbUEFUQ0hdIEltcHJvdmUgYy10cy1tb2RlIGNvbXBvdW5kIGluZGVudHMg KGJ1ZyM3NDUwNykKClByb3Blcmx5IGluZGVudCB0aGUgYm9keSBvZiBjb21wb3VuZCBleHBy ZXNzaW9ucywgZXZlbiB3aGVuIHRoZW4KY29tcG91bmQgZXhwcmVzc2lvbiBpcyBub3QgYXQg dGhlIGJlZ2lubmluZyBvZiBsaW5lIGFuZCB0aGUgcGFyZW50IGlzCm5vdCBhbiBpZi9mb3Iv d2hpbGUvZXRjLiwgYW5kIG1hdGNoZXMgdGhlIGJlaGF2aW9yIG9mIGMtbW9kZS4KClRoaXMg Zml4ZXMgYSBwcm9ibGVtIHRoYXQgaXMgY29tbW9uIHdpdGggbWFjcm9zIGFuZCBpbiB0ZXN0 aW5nCmZyYW1ld29ya3MuIEZvciBleGFtcGxlLCB5b3UgZXhwZWN0IHRoaXMgdG8gaW5kZW50 OgoKVEVTVF9DQVNFKDEpIHsKICAgIGFzc2VydCAoLi4uKTsKfQoKSWYgdGhlIGNvbXBvdW5k IHN0YXRlbWVudCBpcyB0aGUgZnVuY3Rpb24gYm9keSBpdHNlbGYsIGRvbid0IGFwcGx5IHRo aXMKbmV3IHJ1bGUgYW5kIGluc3RlYWQgZ3VpZGUgYnkgdGhlIHBhcmVudCBhbmQgZmlyc3Qg c2libGluZy4KCkknbSBzdXJlIHRoZXJlIGFyZSBzdWJ0bGUgaW50ZXJhY3Rpb25zIHRoYXQg YXJlbid0IGhhbmRsZWQgcHJvcGVybHkgYnkKY2hlY2tpbmcgZm9yICJmdW5jdGlvbl9kZWZp bml0aW9uIiByYXRoZXIgdGhhbiBzb21ldGhpbmcgbW9yZSBnZW5lcmFsLApidXQgaXQgZG9l cyBmaXggdGhlIHRlc3QgY2FzZSBhbmQgdGhlIGNoZWNrIGNhbiBiZSBpbXByb3ZlZCBhcyBt b3JlCmNhc2VzIGFyZSBmb3VuZC4KCiogbGlzcC9wcm9nbW9kZXMvYy10cy1tb2RlLmVsOgoo Yy10cy1tb2RlLS1wYXJlbnQtaXMtbm90LXRvcC1jb21wb3VuZCk6IE5ldyBmdW5jdGlvbi4K KGMtdHMtbW9kZS0taW5kZW50LXN0eWxlcyk6IFVzZSBpdC4KKiB0ZXN0L2xpc3AvcHJvZ21v ZGVzL2MtdHMtbW9kZS1yZXNvdXJjZXMvaW5kZW50LmVydHM6IE5ldwpjb21wb3VuZCBzdGF0 ZW1lbnQgdGVzdC4KLS0tCiBsaXNwL3Byb2dtb2Rlcy9jLXRzLW1vZGUuZWwgICAgICAgICAg ICAgICAgICAgfCAgOSArKysrKysKIC4uLi9wcm9nbW9kZXMvYy10cy1tb2RlLXJlc291cmNl cy9pbmRlbnQuZXJ0cyB8IDMwICsrKysrKysrKysrKysrKysrKysKIDIgZmlsZXMgY2hhbmdl ZCwgMzkgaW5zZXJ0aW9ucygrKQoKZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL2MtdHMt bW9kZS5lbCBiL2xpc3AvcHJvZ21vZGVzL2MtdHMtbW9kZS5lbAppbmRleCBjYmIxMDNjZmFm Ny4uNTliMzRlZjZiOGIgMTAwNjQ0Ci0tLSBhL2xpc3AvcHJvZ21vZGVzL2MtdHMtbW9kZS5l bAorKysgYi9saXNwL3Byb2dtb2Rlcy9jLXRzLW1vZGUuZWwKQEAgLTQwMyw2ICs0MDMsMTIg QEAgYy10cy1tb2RlLS1maXJzdC1zaWJsaW5nCiAgICAgICAgICAgICAgICh0cmVlc2l0LW5v ZGUtc3RhcnQgcGFyZW50KQogICAgICAgICAgICAgICAobGluZS1lbmQtcG9zaXRpb24pKSkp KSkKIAorKGRlZnVuIGMtdHMtbW9kZS0tcGFyZW50LWlzLW5vdC10b3AtY29tcG91bmQgKF9u IHBhcmVudCAmcmVzdCBfKQorICAiTWF0Y2hlcyB3aGVuIFBBUkVOVCBpcyBub3QgdGhlIHRv cCBsZXZlbCBjb21wb3VuZCBzdGF0ZW1lbnQuCitUaGUgdG9wLWxldmVsIGNvbXBvdW5kIGlz IHRoZSB7fSB0aGF0IGltbWVkaWF0ZWx5IGZvbGxvd3MgdGhlIGZ1bmN0aW9uCitzaWduYXR1 cmUuIgorICAobm90IChlcXVhbCAiZnVuY3Rpb25fZGVmaW5pdGlvbiIgKHRyZWVzaXQtbm9k ZS10eXBlICh0cmVlc2l0LW5vZGUtcGFyZW50IHBhcmVudCkpKSkpCisKIChkZWZ1biBjLXRz LW1vZGUtLWluZGVudC1zdHlsZXMgKG1vZGUpCiAgICJJbmRlbnQgcnVsZXMgc3VwcG9ydGVk IGJ5IGBjLXRzLW1vZGUnLgogTU9ERSBpcyBlaXRoZXIgYGMnIG9yIGBjcHAnLiIKQEAgLTQ3 OSw2ICs0ODUsNyBAQCBjLXRzLW1vZGUtLWluZGVudC1zdHlsZXMKICAgICAgICAgICAgOzsg Q2xvc2luZyBicmFja2V0LiAgVGhpcyBzaG91bGQgYmUgYmVmb3JlIGluaXRpYWxpemVyX2xp c3QKICAgICAgICAgICAgOzsgKGFuZCBwcm9iYWJseSBvdGhlcnMpIHJ1bGUgYmVjYXVzZSB0 aGF0IHJ1bGUgKGFuZCBvdGhlcgogICAgICAgICAgICA7OyBzaW1pbGFyIHJ1bGVzKSB3aWxs IG1hdGNoIHRoZSBjbG9zaW5nIGJyYWNrZXQuICAoQnVnIzYxMzk4KQorICAgICAgICAgICAo KGFuZCAobm9kZS1pcyAifSIpIGMtdHMtbW9kZS0tcGFyZW50LWlzLW5vdC10b3AtY29tcG91 bmQpIHBhcmVudC1ib2wgMCkKICAgICAgICAgICAgKChub2RlLWlzICJ9Iikgc3RhbmRhbG9u ZS1wYXJlbnQgMCkKICAgICAgICAgICAgLEAod2hlbiAoZXEgbW9kZSAnY3BwKQogICAgICAg ICAgICAgICAgJygoKG5vZGUtaXMgImFjY2Vzc19zcGVjaWZpZXIiKSBwYXJlbnQtYm9sIDAp CkBAIC00OTgsNiArNTA1LDggQEAgYy10cy1tb2RlLS1pbmRlbnQtc3R5bGVzCiAgICAgICAg ICAgICgocGFyZW50LWlzICJmaWVsZF9kZWNsYXJhdGlvbl9saXN0IikgYy10cy1tb2RlLS1h bmNob3ItcHJldi1zaWJsaW5nIDApCiAKICAgICAgICAgICAgOzsgU3RhdGVtZW50IGluIHt9 IGJsb2Nrcy4KKyAgICAgICAgICAgKChhbmQgKHBhcmVudC1pcyAiY29tcG91bmRfc3RhdGVt ZW50IikgYy10cy1tb2RlLS1wYXJlbnQtaXMtbm90LXRvcC1jb21wb3VuZCkKKyAgICAgICAg ICAgIHBhcmVudC1ib2wgYy10cy1tb2RlLWluZGVudC1vZmZzZXQpCiAgICAgICAgICAgICgo b3IgKGFuZCAocGFyZW50LWlzICJjb21wb3VuZF9zdGF0ZW1lbnQiKQogICAgICAgICAgICAg ICAgICAgICAgOzsgSWYgdGhlIHByZXZpb3VzIHNpYmxpbmcocykgYXJlIG5vdCBvbiB0aGVp cgogICAgICAgICAgICAgICAgICAgICAgOzsgb3duIGxpbmUsIGluZGVudCBhcyBpZiB0aGlz IG5vZGUgaXMgdGhlIGZpcnN0CmRpZmYgLS1naXQgYS90ZXN0L2xpc3AvcHJvZ21vZGVzL2Mt dHMtbW9kZS1yZXNvdXJjZXMvaW5kZW50LmVydHMgYi90ZXN0L2xpc3AvcHJvZ21vZGVzL2Mt dHMtbW9kZS1yZXNvdXJjZXMvaW5kZW50LmVydHMKaW5kZXggMmYzNTQwYzM5NzAuLjYxZTYx Njc3ZWQ3IDEwMDY0NAotLS0gYS90ZXN0L2xpc3AvcHJvZ21vZGVzL2MtdHMtbW9kZS1yZXNv dXJjZXMvaW5kZW50LmVydHMKKysrIGIvdGVzdC9saXNwL3Byb2dtb2Rlcy9jLXRzLW1vZGUt cmVzb3VyY2VzL2luZGVudC5lcnRzCkBAIC0yMjMsNiArMjIzLDM2IEBAIG1ha2VfcGFpcihp bnQgbG9uZ19pZGVudGlmaWVyX2FbXSwgaW50IGxvbmdfaWRlbnRpZmllcl9iW10sCiAKID0t PS09CiAKK05hbWU6IENvbXBvdW5kIFN0YXRlbWVudCBhZnRlciBjb2RlCisKKz0tPQorI2Rl ZmluZSBJT1RBKHZhciwgbikgZm9yIChpbnQgdmFyID0gMDsgdmFyICE9IChuKTsgKyt2YXIp CitpbnQgbWFpbigpCit7CitJT1RBICh2LCAxMCkgeworcHJpbnRmKCIlZCAiLCB2KTsKK30K KworY29uc3QgY2hhciAqbXNnID0gIkhlbGxvLCB3b3JsZCEiOyB7CitwdXRzKCJIZWxsbywg d29ybGQhIik7Cit9Cit9CisKKz0tPQorI2RlZmluZSBJT1RBKHZhciwgbikgZm9yIChpbnQg dmFyID0gMDsgdmFyICE9IChuKTsgKyt2YXIpCitpbnQgbWFpbigpCit7CisgIElPVEEgKHYs IDEwKSB7CisgICAgcHJpbnRmKCIlZCAiLCB2KTsKKyAgfQorCisgIGNvbnN0IGNoYXIgKm1z ZyA9ICJIZWxsbywgd29ybGQhIjsgeworICAgIHB1dHMoIkhlbGxvLCB3b3JsZCEiKTsKKyAg fQorfQorCis9LT0tPQorCiBOYW1lOiBTd2l0Y2gtQ2FzZSBzdGF0ZW1lbnQKIAogPS09Ci0t IAoyLjM5LjUKCg== --------------9qcD07ZIw5QZbEx7jLBAXrkr-- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 01 16:49:45 2024 Received: (at 74507) by debbugs.gnu.org; 1 Dec 2024 21:49:45 +0000 Received: from localhost ([127.0.0.1]:53333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHrp3-0002Mi-9B for submit@debbugs.gnu.org; Sun, 01 Dec 2024 16:49:45 -0500 Received: from mail-pl1-f171.google.com ([209.85.214.171]:60550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHrp0-0002MT-Kh for 74507@debbugs.gnu.org; Sun, 01 Dec 2024 16:49:43 -0500 Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-21288402a26so25247775ad.0 for <74507@debbugs.gnu.org>; Sun, 01 Dec 2024 13:49:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733089717; x=1733694517; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=SusWqjVnxP1zdbnVEFMN4Epygz+IdADdbPJ6vm1Y0nw=; b=hSfXJyggmsMGtCE8dqDhQCjlW6t4KXBjJ1oPb890jPLzztnaBOEEwl+RkQUXODGjHm PNRq8dFxogo1uvmdwBJyJBNRgVqjQcs5WxOnFosTMwf9+pC0aheGmrTBuvYNSxT4+3+h EVO6ybeR6rLNEFnx0B+7dOXHFfbk76YFhz7VOFO8mDZ9rUKpU8b9LQDYMMiaGcL4hE97 jmN8I403Go6xbWkTImKqaBt1eoqIZlnmDh8Li1saIqcGaST1phbPEveTDsMwAp8zaR8K Vy1PNQP5OgzlUprLnzR+3s4jU6nU06Lq5nQkV0HVbP8D/jWEcpOo+QwnBxGaVPMmc1ux 64+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733089717; x=1733694517; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SusWqjVnxP1zdbnVEFMN4Epygz+IdADdbPJ6vm1Y0nw=; b=iFmoSNSnqxUMPKBW8RNiFQVpKoPfzc1Cyr6zfGIyPEr98PrHd5uEUV2b5dVnicwl2R IT0tFX82c1Y2ZSwC16v7Io/iZBnWimpS9M/MAfkcopVpa8pjI4i6xMIZVr6LtA0EXtKN xJOPtHBu9zs07inHk/Ju5p6NyBfDcr33t+DSS5AoXQQKEe6CiYEjsaMGmrUCni/JbfvZ BrPEZzhL90EvhgCZ52A+FAcIsJPHwN4eEk9/9DY0afq6W26I1dAlJEe0bbYgS/YGw+O6 1SCx2t4EFlZTN6KCHGw5dPGrCKGR4P9nlAR2uGdNY57o4LdPr+WpSADqtP6GyWeawcQ2 usHA== X-Forwarded-Encrypted: i=1; AJvYcCVbFLBFOjf3r06gBMUqWkPhEX9Sj0Hku9SuI5/wKprOEefnjawN4gbE6QyH4OMSFDBCHh5o6w==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyUFen+W/fD3Xi/PwUG3qg0HThmNB5+mJfr1MVkWCw7WOfp9vhz eoBi72rNmiiDmcSDXL6odalK/EpYUt6KFzE4HzVqNGkBKmaLOltt X-Gm-Gg: ASbGncuA56pUxkBkLisCCi0pSUmbuJmqPvsGAc9a4y6pKS5CZ92rHjJO+PJ5gyBzwYx RugjXis1rgu9ROUgTBfLnE113aqnNlIP6ZUagoB3rfDo/KKwZEersSBUlbdHUI2hX6VA6yzicxA x3adsG0Juv7r6sziBCXGRR94AxSLkzMy9JGM8FfqWSWpzr5gFC2Y9dOlAleB7Fb9Vs91TVQxjTI UbzpVnxZAmSmBy9pC547ILE0/5FftwLIuWO6haU3qymfLjdb3L6vfbYYJoysUI0n6UjRHcbMw== X-Google-Smtp-Source: AGHT+IHUZL2a+9w0ZQFyGV68G2vHfURcm42NVzT/tNzQOJg/seAgruMW78HPbGqoVi+76uEI2PoYLA== X-Received: by 2002:a17:902:f546:b0:215:6fcd:6cd1 with SMTP id d9443c01a7336-2156fcd6e39mr71650935ad.7.1733089716647; Sun, 01 Dec 2024 13:48:36 -0800 (PST) Received: from smtpclient.apple ([2601:646:8f81:6120:71b7:718f:7faa:8436]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2155249b0cesm33765985ad.211.2024.12.01.13.48.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Dec 2024 13:48:35 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: bug#74507: [PATCH] Indent compounds c-ts-mode when { is not BOL From: Yuan Fu In-Reply-To: <2b677735-ecc0-4fb6-be60-533bfbcc962a@lambda.is> Date: Sun, 1 Dec 2024 13:48:24 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <2407F047-D3EA-4260-9987-D674EFD2932A@gmail.com> References: <87r071yov3.fsf@lambda.is> <86serabhgw.fsf@gnu.org> <1e4fcc9a-4f69-4c3a-b9d6-716d61129e31@lambda.is> <60820855-5672-4083-B7B5-38FF5259BBF4@gmail.com> <2b677735-ecc0-4fb6-be60-533bfbcc962a@lambda.is> To: =?utf-8?Q?J=C3=B8rgen_Kvalsvik?= X-Mailer: Apple Mail (2.3776.700.51) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74507 Cc: Eli Zaretskii , theo@thornhill.no, 74507@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 (-) > On Dec 1, 2024, at 1:51=E2=80=AFAM, J=C3=B8rgen Kvalsvik = wrote: >=20 > On 12/1/24 10:25, Yuan Fu wrote: >>> On Nov 30, 2024, at 12:49=E2=80=AFPM, J=C3=B8rgen Kvalsvik = wrote: >>>=20 >>> On 11/30/24 01:16, Yuan Fu wrote: >>>>> On Nov 29, 2024, at 1:05=E2=80=AFAM, J=C3=B8rgen Kvalsvik = wrote: >>>>>=20 >>>>> On 11/29/24 08:57, Eli Zaretskii wrote: >>>>>>> Cc: theo@thornhill.no,casouri@gmail.com >>>>>>> From: J=C3=B8rgen Kvalsvik >>>>>>> Date: Sun, 24 Nov 2024 10:15:12 +0100 >>>>>>>=20 >>>>>>> * lisp/progmodes/c-ts-mode.el = (c-ts-mode--parent-is-not-top-compound): >>>>>>> New function. >>>>>>> (c-ts-mode--indent-styles): Use it. >>>>>>> * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New = compound >>>>>>> statement test. >>>>>> Please make sure the lines here are not too long (see CONTRIBUTE = for >>>>>> details). >>>>>>> +(defun c-ts-mode--parent-is-not-top-compound (_n parent &rest = _) >>>>>>> + "Matches when PARENT is not the top level compound statement, >>>>>>> +the {} that immediately follows the signature." >>>>>> The first line of a doc string should be a single complete = sentence. >>>>>> Thanks. >>>>>=20 >>>>> Ok. Yuan, would you like me to submit a revision? >>>> Since your assignment is already done, let=E2=80=99s just apply = your patch, and I=E2=80=99ll rebase my changes on top of yours. So yeah, = do send the revision patch, thanks! >>>> Yuan >>>=20 >>> Certainly - I posted it on the bug tracker. >> Thanks J=C3=B8rgen. What did you use to generate the patch? For some = reason I can=E2=80=99t apply it. My git skill isn=E2=80=99t that great = so it could be my problem. If you can apply it fine maybe you can share = the command you used? >=20 > I used git format-patch HEAD~1, and I just tested applying it to = master with `git am = 0001-Indent-compounds-in-c-ts-mode-when-is-not-BOL.patch' which worked. >=20 >> BTW, the commit title is missing. When you add the title, you can = also add the bug number. For example: >> Improve c-ts-mode indentation for macros (bug#74507) >> Yuan >=20 > Sure. I've attached a new patch with the bug in it. I tested it and it = applies cleanly with `git am = 0001-Improve-c-ts-mode-compound-indents-bug-74507.patch' > <0001-Improve-c-ts-mode-compound-indents-bug-74507.patch> Thanks. This patch applied without a problem.=20 I reworked your heuristic into a function rule for better organization, = and changed the condition slightly: (defun c-ts-mode--macro-heuristic-rules (node parent &rest _) "Heuristic indent rule for control flow macros. Eg, #define IOTA(var, n) for (int var =3D 0; var !=3D (n); ++var) int main() { IOTA (v, 10) { printf(\"%d \", v); <-- Here we want to indent counter++; <-- Use baseline rule to align } to prev sibling Checked by \"Compound Statement after code (Bug#74507)\" test. NODE and PARENT are the same as other indent rules." (when (and (treesit-node-match-p parent "compound_statement") (treesit-node-match-p (treesit-node-prev-sibling parent) "expression_statement")) (let ((parent-bol (lambda () (save-excursion (goto-char (treesit-node-start parent)) (back-to-indentation) (point))))) (cond ;; Closing brace. ((treesit-node-match-p node "}") (cons (funcall parent-bol) 0)) ;; First sibling. ((treesit-node-eq (treesit-node-child parent 0 'named) node) (cons (funcall parent-bol) c-ts-mode-indent-offset)))))) Instead of checking whether PARENT is top-level compound_statement, I = make it check whether the previous sibling is an expression_statement. = This way the heuristic works when the macro isn=E2=80=99t at top-level = too. Here=E2=80=99s the updated test: #define IOTA(var, n) for (int var =3D 0; var !=3D (n); ++var) int main() { IOTA (v, 10) { printf("%d ", v); } const char *msg =3D "Hello, world!"; { puts("Hello, world!"); } for (int i =3D 0; i < 10; i++) { IOTA (v, 10) { printf("%d ", v); } } { IOTA (v, 10) { printf("%d ", v); } } } The only test case that doesn=E2=80=99t pass right now is this one: const char *msg =3D "Hello, world!"; { puts("Hello, world!"); } Is this a real use-case? Yuan= From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 01 17:46:20 2024 Received: (at 74507) by debbugs.gnu.org; 1 Dec 2024 22:46:20 +0000 Received: from localhost ([127.0.0.1]:53401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHsho-0005JD-96 for submit@debbugs.gnu.org; Sun, 01 Dec 2024 17:46:20 -0500 Received: from mx.kolabnow.com ([212.103.80.154]:58596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHshl-0005Il-9t for 74507@debbugs.gnu.org; Sun, 01 Dec 2024 17:46:18 -0500 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id 762D620C73F5; Sun, 1 Dec 2024 23:46:11 +0100 (CET) Authentication-Results: ext-mx-out011.mykolab.com (amavis); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:content-language:references:subject:subject :mime-version:date:date:message-id:received:received:received; s=dkim20240523; t=1733093169; x=1734907570; bh=x5SHcm4phGEd9G/M rzDr7P/awdX1etPbdhrjS//Vb1k=; b=iZn+Ck/w1AbK9B1dJsZkZyL0g+eK7wK3 +rsTI3NHvd07yJ9iXtRnwXauHtRqmVjIl4CsUp/fUNdmFvVr6O7jDmTmzgV/hp5m Uzyj/EsyoomaUQbOH4gRlD2j5Fx4lDefzzlB/8W9gDcv2reqMlH7Rgc4bcHXgrwy rrANkY+cFGTACLvdL1NUnb1ADfc17PmE4LKUtuaIA0l1adB6pkheBFfgUkHSsiiz bseUx4Z2SIopm14RVm2uEGaaqmTRZv/+C1b3tuRDDcTb/KYkU9NtRH5mBzFJOnOs fRkqkJ0ETT85nivq8eDsvY/0pWE01asHXqzApnIufLt5S11vRWXUYQ== X-Virus-Scanned: amavis at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1 X-Spam-Level: X-Spam-Status: No, score=-1 tagged_above=-10 required=5 tests=[ALL_TRUSTED=-1] autolearn=ham autolearn_force=no Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out011.mykolab.com [127.0.0.1]) (amavis, port 10024) with ESMTP id sBMfPrbsH9mT; Sun, 1 Dec 2024 23:46:09 +0100 (CET) Received: from int-mx009.mykolab.com (unknown [10.9.13.9]) by mx.kolabnow.com (Postfix) with ESMTPS id 0718D20A5267; Sun, 1 Dec 2024 23:46:07 +0100 (CET) Received: from ext-subm010.mykolab.com (unknown [10.9.6.10]) by int-mx009.mykolab.com (Postfix) with ESMTPS id 9FE1E2330B85; Sun, 1 Dec 2024 23:46:07 +0100 (CET) Message-ID: <67232cd8-0557-4801-be76-76a965a8c60e@lambda.is> Date: Sun, 1 Dec 2024 23:46:06 +0100 MIME-Version: 1.0 Subject: Re: bug#74507: [PATCH] Indent compounds c-ts-mode when { is not BOL To: Yuan Fu References: <87r071yov3.fsf@lambda.is> <86serabhgw.fsf@gnu.org> <1e4fcc9a-4f69-4c3a-b9d6-716d61129e31@lambda.is> <60820855-5672-4083-B7B5-38FF5259BBF4@gmail.com> <2b677735-ecc0-4fb6-be60-533bfbcc962a@lambda.is> <2407F047-D3EA-4260-9987-D674EFD2932A@gmail.com> Content-Language: en-US From: =?UTF-8?Q?J=C3=B8rgen_Kvalsvik?= In-Reply-To: <2407F047-D3EA-4260-9987-D674EFD2932A@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74507 Cc: Eli Zaretskii , theo@thornhill.no, 74507@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 (-) On 12/1/24 22:48, Yuan Fu wrote: > > >> On Dec 1, 2024, at 1:51 AM, Jørgen Kvalsvik wrote: >> >> On 12/1/24 10:25, Yuan Fu wrote: >>>> On Nov 30, 2024, at 12:49 PM, Jørgen Kvalsvik wrote: >>>> >>>> On 11/30/24 01:16, Yuan Fu wrote: >>>>>> On Nov 29, 2024, at 1:05 AM, Jørgen Kvalsvik wrote: >>>>>> >>>>>> On 11/29/24 08:57, Eli Zaretskii wrote: >>>>>>>> Cc: theo@thornhill.no,casouri@gmail.com >>>>>>>> From: Jørgen Kvalsvik >>>>>>>> Date: Sun, 24 Nov 2024 10:15:12 +0100 >>>>>>>> >>>>>>>> * lisp/progmodes/c-ts-mode.el (c-ts-mode--parent-is-not-top-compound): >>>>>>>> New function. >>>>>>>> (c-ts-mode--indent-styles): Use it. >>>>>>>> * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New compound >>>>>>>> statement test. >>>>>>> Please make sure the lines here are not too long (see CONTRIBUTE for >>>>>>> details). >>>>>>>> +(defun c-ts-mode--parent-is-not-top-compound (_n parent &rest _) >>>>>>>> + "Matches when PARENT is not the top level compound statement, >>>>>>>> +the {} that immediately follows the signature." >>>>>>> The first line of a doc string should be a single complete sentence. >>>>>>> Thanks. >>>>>> >>>>>> Ok. Yuan, would you like me to submit a revision? >>>>> Since your assignment is already done, let’s just apply your patch, and I’ll rebase my changes on top of yours. So yeah, do send the revision patch, thanks! >>>>> Yuan >>>> >>>> Certainly - I posted it on the bug tracker. >>> Thanks Jørgen. What did you use to generate the patch? For some reason I can’t apply it. My git skill isn’t that great so it could be my problem. If you can apply it fine maybe you can share the command you used? >> >> I used git format-patch HEAD~1, and I just tested applying it to master with `git am 0001-Indent-compounds-in-c-ts-mode-when-is-not-BOL.patch' which worked. >> >>> BTW, the commit title is missing. When you add the title, you can also add the bug number. For example: >>> Improve c-ts-mode indentation for macros (bug#74507) >>> Yuan >> >> Sure. I've attached a new patch with the bug in it. I tested it and it applies cleanly with `git am 0001-Improve-c-ts-mode-compound-indents-bug-74507.patch' >> <0001-Improve-c-ts-mode-compound-indents-bug-74507.patch> > > Thanks. This patch applied without a problem. > > I reworked your heuristic into a function rule for better organization, and changed the condition slightly: > > (defun c-ts-mode--macro-heuristic-rules (node parent &rest _) > "Heuristic indent rule for control flow macros. > > Eg, > > #define IOTA(var, n) for (int var = 0; var != (n); ++var) > > int main() > { > IOTA (v, 10) { > printf(\"%d \", v); <-- Here we want to indent > counter++; <-- Use baseline rule to align > } to prev sibling > > Checked by \"Compound Statement after code (Bug#74507)\" test. > > NODE and PARENT are the same as other indent rules." > (when (and (treesit-node-match-p parent "compound_statement") > (treesit-node-match-p (treesit-node-prev-sibling parent) > "expression_statement")) > (let ((parent-bol > (lambda () (save-excursion > (goto-char (treesit-node-start parent)) > (back-to-indentation) > (point))))) > (cond > ;; Closing brace. > ((treesit-node-match-p node "}") > (cons (funcall parent-bol) 0)) > ;; First sibling. > ((treesit-node-eq (treesit-node-child parent 0 'named) node) > (cons (funcall parent-bol) > c-ts-mode-indent-offset)))))) > > Instead of checking whether PARENT is top-level compound_statement, I make it check whether the previous sibling is an expression_statement. This way the heuristic works when the macro isn’t at top-level too. Here’s the updated test: > > #define IOTA(var, n) for (int var = 0; var != (n); ++var) > int main() > { > IOTA (v, 10) { > printf("%d ", v); > } > > const char *msg = "Hello, world!"; { > puts("Hello, world!"); > } > > for (int i = 0; > i < 10; > i++) { > IOTA (v, 10) { > printf("%d ", v); > } > } > > { > IOTA (v, 10) { > printf("%d ", v); > } > } > } > > The only test case that doesn’t pass right now is this one: > > const char *msg = "Hello, world!"; { > puts("Hello, world!"); > } > > Is this a real use-case? > > Yuan Maybe - I included it to show that the problem was not tied to it being a macro, but rather { not being the first thing on the line. It would be nice to support it, and c-mode also indents it properly. That being said, it is probably rare enough in practice to prio it less. Thanks, Jørgen From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 01 21:14:35 2024 Received: (at 74507-done) by debbugs.gnu.org; 2 Dec 2024 02:14:36 +0000 Received: from localhost ([127.0.0.1]:53670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHvxL-0007Pq-89 for submit@debbugs.gnu.org; Sun, 01 Dec 2024 21:14:35 -0500 Received: from mail-pl1-f179.google.com ([209.85.214.179]:60843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHvxI-0007Pf-MJ for 74507-done@debbugs.gnu.org; Sun, 01 Dec 2024 21:14:33 -0500 Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2129fd7b1a5so28839115ad.1 for <74507-done@debbugs.gnu.org>; Sun, 01 Dec 2024 18:14:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733105612; x=1733710412; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VUVUyt2qdGLCPI7KBAXPAPE6b8X/EAcN7z19fAbxtWY=; b=Ei2L9a02XeKXIKZXJ36oPSTymlE6+9kXGpZNqxHLIip4V37KzEvWdyDLxO1JFcMUMB 7XFuq/ffIaq899i/gqBp9FM2tbCXN6IzBCzR0Ia1fG1i8tFv4PsGUbgpSiAr1/p/+euW A3uAocDX+fIKP49I3fn+VV36MgQklLdyTjfheqKj7ed+QEMgyppQWMjL3A6NOBjD8616 tVS9eTWbwlSqPvKoqGfO7jfN4Ye3eHxGDHNHCm/VXbv0Lb7umEcHWR7g4e8fv0gEDycf WW3P0UqJN3biEA4tLq1NMdikc6YatjQgHiz+WqjvX95PO5dA13AUwTdb3kEgakU0cH+M u4/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733105612; x=1733710412; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VUVUyt2qdGLCPI7KBAXPAPE6b8X/EAcN7z19fAbxtWY=; b=AQItEY0zBI5Icyf9yf4EomwLiiDHAzUE0zu2w9ItvJink68yXsXkx5wNoyOqXeZwJ6 tQSvPcXIym9IrCKcF7ccdvCNfdhvTdJtZKNOQHi+pTaVv5UyMf8qe9BWpzaQRLy/X8Hr +EwHlY3FjnukbcwM3vXxUoY1Xc+Jn1EVEbTJxsLJvPTL0QiyY/hTTJj4ShynWtjN8uaR fu54/jeg3Pw04QRW9zzjVOPl6XhhXT/pEJSI6EZPWbbmw4RxUoeDO2UT1t9KUYi0yviW 3+B2ywVIUiI1j72YaTM7WdvOTXhWLzOyP3KwCXUUF/kPO3ysL8OXjePqrxG8YnmLKPV2 jFaQ== X-Forwarded-Encrypted: i=1; AJvYcCUu8YDMSA2washxz79YUCdpw708niM81/SyTX/1X0EbNIvR2vjlBknQ6t47p9duziPH1goHfTY/pzlx@debbugs.gnu.org X-Gm-Message-State: AOJu0YyCVL0ky3XhLoyVADx2JXThyvq6QtSLqmskcE0ne3IFe3mHuOII /4PsYaKMLtPp1cnvSkvKht2xdun5SMfNTYCNfAnai7AMg7Wois7O X-Gm-Gg: ASbGnctgzwYkf3R5/2Hud8/XX1jt1lO1DmQV9EQ3ic3XNQ1K129fQTE5A81qcH37Pvq tWJMfYOCCpx2aSLdiFJ/5lKilxV9qj2BTfEJ7jIKcwF+pqqM8NwEReWPGGwI9DIebK4cFXzaVvl mOXw/hm2vcQwH1cFVU3V51u7uxaZZNRbKVK9UyxdzJXq70XPzivjZo/lAJx7nnkXk7aN7z0BxGQ Lnk8CY5p2hLk6C0aJAGMn5bhXE85/qerKQOTRopryL3oVh1rBtD8yRlAaGH9jh+jXkH2heriA== X-Google-Smtp-Source: AGHT+IHRq9rcB9ptJBUQN4v/awxRcPyvUHF7oUywSbfNlNpMO1wbKP2pPn2h5kDj3b2OFU/qAp2Vrw== X-Received: by 2002:a17:902:f64e:b0:215:7893:a99f with SMTP id d9443c01a7336-2157893abbdmr74072155ad.34.1733105611619; Sun, 01 Dec 2024 18:13:31 -0800 (PST) Received: from smtpclient.apple ([2601:646:8f81:6120:71b7:718f:7faa:8436]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2156344b362sm28785605ad.62.2024.12.01.18.13.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Dec 2024 18:13:30 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: bug#74507: [PATCH] Indent compounds c-ts-mode when { is not BOL From: Yuan Fu In-Reply-To: <67232cd8-0557-4801-be76-76a965a8c60e@lambda.is> Date: Sun, 1 Dec 2024 18:13:19 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <87r071yov3.fsf@lambda.is> <86serabhgw.fsf@gnu.org> <1e4fcc9a-4f69-4c3a-b9d6-716d61129e31@lambda.is> <60820855-5672-4083-B7B5-38FF5259BBF4@gmail.com> <2b677735-ecc0-4fb6-be60-533bfbcc962a@lambda.is> <2407F047-D3EA-4260-9987-D674EFD2932A@gmail.com> <67232cd8-0557-4801-be76-76a965a8c60e@lambda.is> To: =?utf-8?Q?J=C3=B8rgen_Kvalsvik?= X-Mailer: Apple Mail (2.3776.700.51) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74507-done Cc: Eli Zaretskii , Theodor Thornhill , 74507-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: -1.0 (-) > On Dec 1, 2024, at 2:46=E2=80=AFPM, J=C3=B8rgen Kvalsvik = wrote: >=20 > On 12/1/24 22:48, Yuan Fu wrote: >>> On Dec 1, 2024, at 1:51=E2=80=AFAM, J=C3=B8rgen Kvalsvik = wrote: >>>=20 >>> On 12/1/24 10:25, Yuan Fu wrote: >>>>> On Nov 30, 2024, at 12:49=E2=80=AFPM, J=C3=B8rgen Kvalsvik = wrote: >>>>>=20 >>>>> On 11/30/24 01:16, Yuan Fu wrote: >>>>>>> On Nov 29, 2024, at 1:05=E2=80=AFAM, J=C3=B8rgen Kvalsvik = wrote: >>>>>>>=20 >>>>>>> On 11/29/24 08:57, Eli Zaretskii wrote: >>>>>>>>> Cc: theo@thornhill.no,casouri@gmail.com >>>>>>>>> From: J=C3=B8rgen Kvalsvik >>>>>>>>> Date: Sun, 24 Nov 2024 10:15:12 +0100 >>>>>>>>>=20 >>>>>>>>> * lisp/progmodes/c-ts-mode.el = (c-ts-mode--parent-is-not-top-compound): >>>>>>>>> New function. >>>>>>>>> (c-ts-mode--indent-styles): Use it. >>>>>>>>> * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New = compound >>>>>>>>> statement test. >>>>>>>> Please make sure the lines here are not too long (see = CONTRIBUTE for >>>>>>>> details). >>>>>>>>> +(defun c-ts-mode--parent-is-not-top-compound (_n parent &rest = _) >>>>>>>>> + "Matches when PARENT is not the top level compound = statement, >>>>>>>>> +the {} that immediately follows the signature." >>>>>>>> The first line of a doc string should be a single complete = sentence. >>>>>>>> Thanks. >>>>>>>=20 >>>>>>> Ok. Yuan, would you like me to submit a revision? >>>>>> Since your assignment is already done, let=E2=80=99s just apply = your patch, and I=E2=80=99ll rebase my changes on top of yours. So yeah, = do send the revision patch, thanks! >>>>>> Yuan >>>>>=20 >>>>> Certainly - I posted it on the bug tracker. >>>> Thanks J=C3=B8rgen. What did you use to generate the patch? For = some reason I can=E2=80=99t apply it. My git skill isn=E2=80=99t that = great so it could be my problem. If you can apply it fine maybe you can = share the command you used? >>>=20 >>> I used git format-patch HEAD~1, and I just tested applying it to = master with `git am = 0001-Indent-compounds-in-c-ts-mode-when-is-not-BOL.patch' which worked. >>>=20 >>>> BTW, the commit title is missing. When you add the title, you can = also add the bug number. For example: >>>> Improve c-ts-mode indentation for macros (bug#74507) >>>> Yuan >>>=20 >>> Sure. I've attached a new patch with the bug in it. I tested it and = it applies cleanly with `git am = 0001-Improve-c-ts-mode-compound-indents-bug-74507.patch' >>> <0001-Improve-c-ts-mode-compound-indents-bug-74507.patch> >> Thanks. This patch applied without a problem. >> I reworked your heuristic into a function rule for better = organization, and changed the condition slightly: >> (defun c-ts-mode--macro-heuristic-rules (node parent &rest _) >> "Heuristic indent rule for control flow macros. >> Eg, >> #define IOTA(var, n) for (int var =3D 0; var !=3D (n); ++var) >> int main() >> { >> IOTA (v, 10) { >> printf(\"%d \", v); <-- Here we want to indent >> counter++; <-- Use baseline rule to align >> } to prev sibling >> Checked by \"Compound Statement after code (Bug#74507)\" test. >> NODE and PARENT are the same as other indent rules." >> (when (and (treesit-node-match-p parent "compound_statement") >> (treesit-node-match-p (treesit-node-prev-sibling parent) >> "expression_statement")) >> (let ((parent-bol >> (lambda () (save-excursion >> (goto-char (treesit-node-start parent)) >> (back-to-indentation) >> (point))))) >> (cond >> ;; Closing brace. >> ((treesit-node-match-p node "}") >> (cons (funcall parent-bol) 0)) >> ;; First sibling. >> ((treesit-node-eq (treesit-node-child parent 0 'named) node) >> (cons (funcall parent-bol) >> c-ts-mode-indent-offset)))))) >> Instead of checking whether PARENT is top-level compound_statement, I = make it check whether the previous sibling is an expression_statement. = This way the heuristic works when the macro isn=E2=80=99t at top-level = too. Here=E2=80=99s the updated test: >> #define IOTA(var, n) for (int var =3D 0; var !=3D (n); ++var) >> int main() >> { >> IOTA (v, 10) { >> printf("%d ", v); >> } >> const char *msg =3D "Hello, world!"; { >> puts("Hello, world!"); >> } >> for (int i =3D 0; >> i < 10; >> i++) { >> IOTA (v, 10) { >> printf("%d ", v); >> } >> } >> { >> IOTA (v, 10) { >> printf("%d ", v); >> } >> } >> } >> The only test case that doesn=E2=80=99t pass right now is this one: >> const char *msg =3D "Hello, world!"; { >> puts("Hello, world!"); >> } >> Is this a real use-case? >> Yuan >=20 > Maybe - I included it to show that the problem was not tied to it = being a macro, but rather { not being the first thing on the line. It = would be nice to support it, and c-mode also indents it properly. >=20 > That being said, it is probably rare enough in practice to prio it = less. Ok, I pushed your patch and my indentation rework to master. I end up = removing the test mentioned above since it=E2=80=99s not a real = use-case, in favor of making the heuristic indent rule more specific. Yuan From unknown Sat Aug 16 19:16:49 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 30 Dec 2024 12:24:06 +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