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: Thu, 05 Oct 2023 10:16:45 +0300 Message-ID: <83lech4jz6.fsf@gnu.org> References: <1bb29ad2-270d-4b19-8d5f-90f23b9fd100@mailo.com> <83edih1m9i.fsf@gnu.org> 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="23092"; mail-complaints-to="usenet@ciao.gmane.io" Cc: btuin@mailo.com, 66152@debbugs.gnu.org To: casouri@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 05 09:18:11 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 1qoIcd-0005n4-8r for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Oct 2023 09:18:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoIcF-00032w-7Y; Thu, 05 Oct 2023 03:17:48 -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 1qoIcD-00032X-90 for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 03:17:45 -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 1qoIcC-00041j-JD for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 03:17:44 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qoIcU-0004uW-Fn for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 03:18: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: Thu, 05 Oct 2023 07:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66152 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66152-submit@debbugs.gnu.org id=B66152.169649023818816 (code B ref 66152); Thu, 05 Oct 2023 07:18:02 +0000 Original-Received: (at 66152) by debbugs.gnu.org; 5 Oct 2023 07:17:18 +0000 Original-Received: from localhost ([127.0.0.1]:45892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoIbi-0004tL-5l for submit@debbugs.gnu.org; Thu, 05 Oct 2023 03:17:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58774) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoIbf-0004t0-Hz for 66152@debbugs.gnu.org; Thu, 05 Oct 2023 03:17:12 -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 1qoIbF-0003pJ-Tj; Thu, 05 Oct 2023 03:16:47 -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=bUItr4yT+X7kule3whuY0YqZH0CGbhJAhc7ggvSp8Og=; b=rEYzO3hEPhzZtfPpVsUe o2DbW2BaPBG0AwpVuCc2T/fysmrfXBrI5elbyRm6wvb9jU1hV5Ig4JxM02mglw14O+OoqJY5FZIvh lnUMa0c87O5kE46x6wKfFXx5iPKfQJO/6s3mFR/FCedku4XTrwBmUmJTi7HfFi2LLjdvwqHo1QLVD LGnhjXYViXA17kfCe6qXPUYqriMs0s12IO8lYbjMbCuMQoKfybste7Ivl4g+dxjHx5IY16hwll8Gr +SlN4omAXDN1TKERSo3E/x59BG6hiFIiYWBg4N2VHy5zfoUVieV3zJ0wWfAbZUTfrBxEKt7LTNr7C Fm7yfRakS1ZN8w==; In-Reply-To: <83edih1m9i.fsf@gnu.org> (message from Eli Zaretskii on Fri, 29 Sep 2023 10:17:29 +0300) 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:271845 Archived-At: Ping! Yuan, I would really like to use the first patch in Emacs 29.2, if it looks OK to you. > Cc: 66152@debbugs.gnu.org > Date: Fri, 29 Sep 2023 10:17:29 +0300 > From: Eli Zaretskii > > > 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. > > > >