GNU bug report logs - #61635
30.0.50; c++-ts-mode: "}" indented wrong when a class in namespace

Previous Next

Package: emacs;

Reported by: xhcoding <xhcoding <at> foxmail.com>

Date: Sun, 19 Feb 2023 17:09:03 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Fixed in version 29.1

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61635 in the body.
You can then email your comments to 61635 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#61635; Package emacs. (Sun, 19 Feb 2023 17:09:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to xhcoding <xhcoding <at> foxmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 19 Feb 2023 17:09:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: xhcoding <xhcoding <at> foxmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; c++-ts-mode: "}" indented wrong when a class in namespace
Date: Sun, 19 Feb 2023 21:01:35 +0800
The closing '};' is indented wrong in the following class/struct definition:

namespace test {
  class Name {
};  <--  error indent
    
} <-- when press tab, minibuffer output "Wrong type argument: wholenump, -2" 



In GNU Emacs 30.0.50 (build 5, x86_64-w64-mingw32)
Repository revision: 07a76a06f9a438e2a1bf1e565e3e78f7927c37f2
Repository branch: master
Windowing system distributor 'Microsoft Corp.', version 10.0.22621
System Description: Microsoft Windows 10 Home China (v10.0.2009.22621.1105)

Configured using:
 'configure --prefix=/d/emacs-build/pkg/master-x86_64 'CFLAGS=-Ofast -fno-finite-math-only -fomit-frame-pointer'
 --with-zlib --with-xpm --with-xml2 --with-tree-sitter --without-tiff --with-rsvg --with-png --with-lcms2 --with-json
 --with-jpeg --with-harfbuzz --with-gnutls --with-gif --without-cairo --disable-build-details --without-dbus
 --with-compress-install --with-small-ja-dic'

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XPM ZLIB

Important settings:
  value of $LANG: CHS
  locale-coding-system: cp936





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61635; Package emacs. (Sun, 19 Feb 2023 22:14:01 GMT) Full text and rfc822 format available.

Message #8 received at 61635 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Martín <mardani29 <at> yahoo.es>
To: xhcoding <xhcoding <at> foxmail.com>
Cc: 61635 <at> debbugs.gnu.org
Subject: Re: bug#61635: 30.0.50; c++-ts-mode: "}" indented wrong when a
 class in namespace
Date: Sun, 19 Feb 2023 23:13:06 +0100
[Message part 1 (text/plain, inline)]
tags 61635 + patch
quit

xhcoding <xhcoding <at> foxmail.com> writes:

> The closing '};' is indented wrong in the following class/struct definition:
>
> namespace test {
>   class Name {
> };  <--  error indent
>     
> } <-- when press tab, minibuffer output "Wrong type argument: wholenump, -2" 
>
>

The attached patch fixes the problem by considering "declaration_list"
nodes as "blocks".

[0001-Add-declaration_list-to-c-ts-common-indent-type-rege.patch (text/x-patch, attachment)]

Added tag(s) patch. Request was from Daniel Martín <mardani29 <at> yahoo.es> to control <at> debbugs.gnu.org. (Sun, 19 Feb 2023 22:14:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61635; Package emacs. (Mon, 20 Feb 2023 14:10:02 GMT) Full text and rfc822 format available.

Message #13 received at 61635 <at> debbugs.gnu.org (full text, mbox):

From: Theodor Thornhill <theo <at> thornhill.no>
To: Daniel Martín <mardani29 <at> yahoo.es>
Cc: 61635 <at> debbugs.gnu.org, xhcoding <xhcoding <at> foxmail.com>
Subject: Re: bug#61635: 30.0.50; c++-ts-mode: "}" indented wrong when a
 class in namespace
Date: Mon, 20 Feb 2023 15:09:06 +0100
Daniel Martín <mardani29 <at> yahoo.es> writes:

> tags 61635 + patch
> quit
>
> xhcoding <xhcoding <at> foxmail.com> writes:
>
>> The closing '};' is indented wrong in the following class/struct definition:
>>
>> namespace test {
>>   class Name {
>> };  <--  error indent
>>     
>> } <-- when press tab, minibuffer output "Wrong type argument: wholenump, -2" 
>>
>>


Thanks! Installed and pushed :-)

Theo




bug marked as fixed in version 29.1, send any further explanations to 61635 <at> debbugs.gnu.org and xhcoding <xhcoding <at> foxmail.com> Request was from Yuan Fu <casouri <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 25 Feb 2023 04:54:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 25 Mar 2023 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 26 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.