From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#66152: 30.0.50; Missing indent rules in c-ts-mode Date: Fri, 29 Sep 2023 10:17:29 +0300 Message-ID: <83edih1m9i.fsf@gnu.org> References: <1bb29ad2-270d-4b19-8d5f-90f23b9fd100@mailo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23236"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66152@debbugs.gnu.org To: Augustin =?UTF-8?Q?Ch=C3=A9neau?= (BTuin) , Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 29 09:19:02 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 1qm7mA-0005iE-5Q for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 29 Sep 2023 09:19:02 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm7lx-0001Tw-Q7; Fri, 29 Sep 2023 03:18:49 -0400 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 1qm7lw-0001Ti-14 for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2023 03:18:48 -0400 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 1qm7lv-0000ST-Oh for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2023 03:18:47 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qm7mA-0001HV-BU for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2023 03:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Sep 2023 07:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66152 X-GNU-PR-Package: emacs Original-Received: via spool by 66152-submit@debbugs.gnu.org id=B66152.16959719014871 (code B ref 66152); Fri, 29 Sep 2023 07:19:02 +0000 Original-Received: (at 66152) by debbugs.gnu.org; 29 Sep 2023 07:18:21 +0000 Original-Received: from localhost ([127.0.0.1]:55054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qm7lU-0001GP-8d for submit@debbugs.gnu.org; Fri, 29 Sep 2023 03:18:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47494) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qm7lN-0001Fw-M6 for 66152@debbugs.gnu.org; Fri, 29 Sep 2023 03:18:18 -0400 Original-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 1qm7kz-0000Mb-1Z; Fri, 29 Sep 2023 03:17:49 -0400 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=5j8z2f38hsxOGP3kbcI5ebojMyjhCR6a9KPbNrTJNwo=; b=DxDSob2rui7eE1ebHlxU KoOqWn7BwLtyB0hRxZLx0NcyKVZv1p/HgSjHCRqpKtaltrk5Fc9WQR35HOb3gvuZMDCFH0ol9MWak s/ouvaF8sowk1M+zY6GeNmZImFbs5DVHF6opXR8+Qi4ShY+ozPVhhYIZ4kzhtETHbI3tTXu0iyNrD zkGROb07vnbro5BL0VjBTjvoPKE7d4+OEiR+AspbxKL9afhibkZQD1b8KGVZ4nGTEyqmySbC7V+01 ortZJ93kNSFdmxrOArlkgN+oX01+sv6vPh7a+blJblqrFcu2MYKFyP3ExrxthuBbxmqUyw8FJpyEq OHkqJX9tRDgnEg==; In-Reply-To: <1bb29ad2-270d-4b19-8d5f-90f23b9fd100@mailo.com> (btuin@mailo.com) 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:271471 Archived-At: > Date: Tue, 26 Sep 2023 14:29:07 +0200 > From: Augustin Chéneau (BTuin) > > I found some more issues. > > First, there is no rule for an element in an else clause: > > > if (true) > do_something(); > else > do_something_else(); > > > "do_something_else" is not indented. > > There is also something weird with the bsd indent style. It indents > do_something and do_something_else to parent-bol with 0 offset, so the > result is: > > if (true) > do_something(); > else > do_something_else(); > > > It is very different from the bsd style from c-mode, which produces this: > > if (true) > do_something(); > else > do_something_else(); > > By looking at random files from OpenBSD, they do indent their > expressions inside if and else: > > > (lines 277, 484, and 527) > > > > Also there is a second patch which tries to handle specific types of > comments. I don't know how popular it is, but some people use these > kind of comments: > > /*---------. > | %param. | > `---------*/ > > Here we want the vertical bar ("|") to be indented at the same column as > the first "/". > > Currently the result is this: > > /*---------. > | %param. | > `---------*/ > > This patch is a just proof of concept. If this new behavior is indeed > wanted, I would clean it up and adapt other modes. Yuan, any comments? If the first patch looks good to you, I'd like to install it on the release branch.