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#72263: 31.0.50; Wrong indentation c++-ts-mode Date: Sat, 17 Aug 2024 10:28:26 +0300 Message-ID: <861q2n621x.fsf@gnu.org> References: <87cyn3vequ.fsf.ref@aol.com> <87cyn3vequ.fsf@aol.com> <86h6ce53pw.fsf@gnu.org> <266A7254-4449-4F6A-A69F-D98C6DF8CC2E@aol.com> <868qxgygpt.fsf@gnu.org> <86C92F83-D334-4029-8AD2-B9D5BAD620D9@gmail.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="22913"; mail-complaints-to="usenet@ciao.gmane.io" Cc: spacibba@aol.com, 72263-done@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 17 09:30:00 2024 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 1sfDss-0005nM-FC for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Aug 2024 09:29:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sfDsN-0007hL-Pn; Sat, 17 Aug 2024 03:29:27 -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 1sfDsK-0007h0-VG for bug-gnu-emacs@gnu.org; Sat, 17 Aug 2024 03:29:25 -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 1sfDsK-0004sj-H6 for bug-gnu-emacs@gnu.org; Sat, 17 Aug 2024 03:29:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=kSmbu2kz+JgBA3kOLC+fWAo/hJdgc2xJVTi1PsmMrAw=; b=F4uDyQa+f1SaJBoCP1RLSHq1X/CPH9pGKbyyMILA+17KKkLReIh7iobQu61O9Hd13L+585fHAFkiFon2uIciYKG+U9x+HtzY68mUAPw1+cTRkkUVjmc9bp6EKGJYE6usVLJvugp2YO+fTfVocxNCCSdu8NoVfLQwbRAhBgRDOjcnmRZ7bjEfcTg0ycpDqbnHExFheIXuAjbqD81iqJia+ecis3TmcNeX4gcCW2N4I7N9RyuBlszJeXyvIw6BDFRBCYk4cyVBT9faqUNvgktlRAgvOd64rua/nVI4HqxNpi0B4MAC4qH3khdkJeHX99MZQL7FkfQi5AzNNby9DkKBrw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sfDsw-0007iB-7P for bug-gnu-emacs@gnu.org; Sat, 17 Aug 2024 03:30:02 -0400 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Aug 2024 07:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 72263 X-GNU-PR-Package: emacs Mail-Followup-To: 72263@debbugs.gnu.org, eliz@gnu.org, spacibba@aol.com Original-Received: via spool by 72263-done@debbugs.gnu.org id=D72263.172387975829563 (code D ref 72263); Sat, 17 Aug 2024 07:30:02 +0000 Original-Received: (at 72263-done) by debbugs.gnu.org; 17 Aug 2024 07:29:18 +0000 Original-Received: from localhost ([127.0.0.1]:53309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sfDsE-0007gl-Ed for submit@debbugs.gnu.org; Sat, 17 Aug 2024 03:29:18 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sfDsD-0007gY-0m for 72263-done@debbugs.gnu.org; Sat, 17 Aug 2024 03:29:17 -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 1sfDrU-0004pr-RV; Sat, 17 Aug 2024 03:28:33 -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=kSmbu2kz+JgBA3kOLC+fWAo/hJdgc2xJVTi1PsmMrAw=; b=pzep7Vl9Blsi8kpFmeeP rmmCRUQ05Bl/cbB8x32nPBveOLB8m37JlS+DuSmOAD4X6n9Kl9iQixR3MHaSlFHRAKNjeMVr/wUnT +tY/eFlDmpAXGACkB7tkMEpvzZ18fON4XysnLpNEjPe9vDiBcf/R4hXr6hw0Kd4ooeWKvFHL9rpUo GGsB/XOiKlfrk8OxpYcN/cMurHcG+f4I9fOAfssND1ps//I7d5a7hyKPlCm3cI52dxQlFs4FI8jsI CSyegl6cRF/2U3vxsytqZmjxQ3bpr9L+JjsjlnFdHVWfZO9pNfpashqTw0VAZuOaQB09sPFoX8Hu2 CKqE6fHBsVcOcA==; In-Reply-To: <86C92F83-D334-4029-8AD2-B9D5BAD620D9@gmail.com> (message from Yuan Fu on Thu, 1 Aug 2024 00:03:52 -0700) 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:290219 Archived-At: > From: Yuan Fu > Date: Thu, 1 Aug 2024 00:03:52 -0700 > Cc: Ergus , > 72263@debbugs.gnu.org > > Pushed a fix for the original bug to emacs-30. Now it indents like this: > > namespace A { > > T myfunction1(const char *fname) > { > } > > template > T myfunction2(const char *fname) > { > } > } > > > > On Jul 31, 2024, at 10:06 PM, Eli Zaretskii wrote: > > > >> Date: Wed, 31 Jul 2024 23:09:53 +0200 > >> From: Ergus > >> CC: 72263@debbugs.gnu.org > >> > >> I found another indentation issue in if-else conditions without > >> parenthesis: > >> > >> if (pid == 0) > >> print "hello from the child" > >> else > >> print "hello from the parent" > >> > >> The else is not indented properly: > > > > The above is not valid C++ code, AFAIU, so I don't understand why you > > expect c++-ts-mode to handle it properly (and what exactly is "proper" > > indentation in that case?). > > As Eli said, if you add the trailing semicolon then it indents fine. If the code isn’t grammatically correct it’s hard for tree-sitter modes to indent the code. No further comments, so I'm now closing this bug.