From unknown Mon Aug 18 14:21:59 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#35347 <35347@debbugs.gnu.org> To: bug#35347 <35347@debbugs.gnu.org> Subject: Status: CC Mode 5.33.2 (C++//l); An improper space is being added to the tabbing of a access specifier label inside of a class. Reply-To: bug#35347 <35347@debbugs.gnu.org> Date: Mon, 18 Aug 2025 21:21:59 +0000 retitle 35347 CC Mode 5.33.2 (C++//l); An improper space is being added to = the tabbing of a access specifier label inside of a class. reassign 35347 cc-mode submitter 35347 Dylan Johnson severity 35347 normal tag 35347 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 20 14:07:07 2019 Received: (at submit) by debbugs.gnu.org; 20 Apr 2019 18:07:07 +0000 Received: from localhost ([127.0.0.1]:46751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHuOJ-0006lh-IP for submit@debbugs.gnu.org; Sat, 20 Apr 2019 14:07:07 -0400 Received: from mail-lj1-f180.google.com ([209.85.208.180]:41640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHu8R-0006Ka-0e for submit@debbugs.gnu.org; Sat, 20 Apr 2019 13:50:43 -0400 Received: by mail-lj1-f180.google.com with SMTP id k8so7057240lja.8 for ; Sat, 20 Apr 2019 10:50:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=BdKQPVK6T434vILvaolIIKDBD1DF8TyDxRtWshdyKUo=; b=tyhqW3xt/cX2qregaPOfRaMfdZip4Epeh+qHs6DgYqBbmlxXlwcCw2PcvaJx5sSPDc 6TRoDBQ9JC2+OGKaKTJfkggl+PB0eoktrKjzEvo3mjLnOY+KkksPKYjms/m54VGhbtW2 eMd2yiPDaN87g8Dsh14lICThJhqGG9AzNQfP9EQLVV5j7yKaUKKXRGstFOADU7uq0u6Z zJu872iTSGEUvXyKR/z7QLZ37QrltIRkxeT3mG+6sROgsWpcFsTHuopszRLcHGktn6eK zzKrR9X8Gbj3m78oMsid/ut1kJgwPw7fnSwGtaWzolijy6m7tTjsysOgOkAi8F60qGhD Zn2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=BdKQPVK6T434vILvaolIIKDBD1DF8TyDxRtWshdyKUo=; b=IC9oXizrcSCY7SPzbkYLBH658+EFT9afjLdH350bh/Aik1hQ6vi5Vhsm0itBI6eX5S FZ2ARIl59xFGOLfQ0vz1tbHum68k49WMeGRoQYWq3Iz6gsYQ8Saoald8GHvJ2YUBbB4/ jgZU9fvQ6IZW1boSLwTUWm3kZfpqOUeBb6xe43frhnIRup/wQhjPpv0RhWE5nw1KNgIj TuQtTBTa8P8eirfR2lbM8IAIB5kLq3yPdGbU1vVWJ0wwt+S1lR7aVUWKIEAZ5YdFIC9g a1pBKrwzdKkyBMWxp3cUI3p6RarszP/cVKNbt8fZapHZN0xXS8JYYjN2iu2FtLUCofD0 XDbw== X-Gm-Message-State: APjAAAVKYfYIAn5B7+GPl32svvplHWop0+IdEc+McKgmWhwKZyuT+GNf LL0ze6XMVPcYa2hBWddGkWOHxJBx2lcd6Viidi/GSYOQxsg= X-Google-Smtp-Source: APXvYqwt+g72XGmNgZvTZna8NS8RZyaGxqR0EjFVW797TyVBmKKduVO+Hwm3E1gF/69ZSMYu8UMTjPTQZ9k4BMN3HpE= X-Received: by 2002:a2e:8618:: with SMTP id a24mr5548955lji.192.1555782636486; Sat, 20 Apr 2019 10:50:36 -0700 (PDT) MIME-Version: 1.0 From: Dylan Johnson Date: Sat, 20 Apr 2019 11:50:25 -0600 Message-ID: Subject: CC Mode 5.33.2 (C++//l); An improper space is being added to the tabbing of a access specifier label inside of a class. To: submit@debbugs.gnu.org Content-Type: multipart/alternative; boundary="0000000000006543d60586f9df89" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 20 Apr 2019 14:07:05 -0400 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 (-) --0000000000006543d60586f9df89 Content-Type: text/plain; charset="UTF-8" When you define a class with a macro between the ``class'' specifier and the name of the class you will observe that the access labels ``public:'' and ``private:'' are interpreted as a labels by the autoformatter and an incorrect space is added to its tabbing. Attempts to correct this with ``C - c C - o'' failed. Here is an example: \\\ class TEST_MACRO Test_class { public: Test_class(); virtual ~Test_class(); void method1(); int member1(); }; \\\ Thanks, Dylan Emacs : GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5) of 2019-04-13 Package: CC Mode 5.33.2 (C++//l) Buffer Style: gnu c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-string-delim gen-comment-delim syntax-properties 1-bit) current state: ============== (setq c-basic-offset 2 c-comment-only-line-offset '(0 . 0) c-indent-comment-alist '((anchored-comment column . 0) (end-block space . 1) (cpp-end-block space . 2)) c-indent-comments-syntactically-p nil c-block-comment-prefix "" c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") (awk-mode . " --0000000000006543d60586f9df89 Content-Type: text/html; charset="UTF-8"

When you define a class with a macro between the ``class'' specifier and

the name of the class you will observe that the access labels ``public:''

and ``private:'' are interpreted as a labels by the autoformatter

and an incorrect space is added to its tabbing. Attempts to correct this

with ``C - c C - o'' failed.


Here is an example:


\\\


class TEST_MACRO Test_class

{

public:

Test_class();

virtual ~Test_class();

void method1();

int member1();

};


\\\


Thanks,

Dylan


Emacs : GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5)

of 2019-04-13

Package: CC Mode 5.33.2 (C++//l)

Buffer Style: gnu

c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-string-delim gen-comment-delim syntax-properties 1-bit)


current state:

==============

(setq

c-basic-offset 2

c-comment-only-line-offset '(0 . 0)

c-indent-comment-alist '((anchored-comment column . 0) (end-block space . 1)

(cpp-end-block space . 2))

c-indent-comments-syntactically-p nil

c-block-comment-prefix ""

c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") (awk-mode . "

--0000000000006543d60586f9df89-- From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 20 14:08:32 2019 Received: (at control) by debbugs.gnu.org; 20 Apr 2019 18:08:32 +0000 Received: from localhost ([127.0.0.1]:46756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHuPg-0006og-0O for submit@debbugs.gnu.org; Sat, 20 Apr 2019 14:08:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33431) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHuPe-0006oT-Sh for control@debbugs.gnu.org; Sat, 20 Apr 2019 14:08:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35884) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHuPZ-0008Nt-OH for control@debbugs.gnu.org; Sat, 20 Apr 2019 14:08:25 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1hHuPX-0003YU-El for control@debbugs.gnu.org; Sat, 20 Apr 2019 14:08:25 -0400 Subject: control message for bug 35347 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Sat, 20 Apr 2019 14:08:23 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control 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 (---) reassign 35347 cc-mode From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 20 14:42:04 2019 Received: (at 35347) by debbugs.gnu.org; 20 Apr 2019 18:42:04 +0000 Received: from localhost ([127.0.0.1]:46771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHuw8-0001FL-BT for submit@debbugs.gnu.org; Sat, 20 Apr 2019 14:42:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39680) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHuw6-0001Es-88 for 35347@debbugs.gnu.org; Sat, 20 Apr 2019 14:42:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHuw1-0007Yv-18; Sat, 20 Apr 2019 14:41:57 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1hHuw0-0006H0-7v; Sat, 20 Apr 2019 14:41:56 -0400 From: Glenn Morris To: 35347@debbugs.gnu.org Subject: Re: bug#35347: CC Mode 5.33.2 (C++//l); An improper space is being added to the tabbing of a access specifier label inside of a class. References: Mail-Followup-To: 35347@debbugs.gnu.org, dylanatasmsa@gmail.com Date: Sat, 20 Apr 2019 14:41:55 -0400 In-Reply-To: (Dylan Johnson's message of "Sat, 20 Apr 2019 11:50:25 -0600") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 35347 Cc: Dylan Johnson 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: , Reply-To: 35347@debbugs.gnu.org, dylanatasmsa@gmail.com Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Report reassigned to cc-mode. Dylan Johnson wrote: > When you define a class with a macro between the ``class'' specifier and > > the name of the class you will observe that the access labels ``public:'' > > and ``private:'' are interpreted as a labels by the autoformatter > > and an incorrect space is added to its tabbing. Attempts to correct this > > with ``C - c C - o'' failed. > > > Here is an example: > > > \\\ > > > class TEST_MACRO Test_class > > { > > public: > > Test_class(); > > virtual ~Test_class(); > > void method1(); > > int member1(); > > }; > > > \\\ > > > Thanks, > > Dylan > > > Emacs : GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5) > > of 2019-04-13 > > Package: CC Mode 5.33.2 (C++//l) > > Buffer Style: gnu > > c-emacs-features: (pps-extended-state col-0-paren posix-char-classes > gen-string-delim gen-comment-delim syntax-properties 1-bit) > > > current state: > > ============== > > (setq > > c-basic-offset 2 > > c-comment-only-line-offset '(0 . 0) > > c-indent-comment-alist '((anchored-comment column . 0) (end-block space . 1) > > (cpp-end-block space . 2)) > > c-indent-comments-syntactically-p nil > > c-block-comment-prefix "" > > c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") (awk-mode . " From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 20 15:09:28 2019 Received: (at 35347) by debbugs.gnu.org; 20 Apr 2019 19:09:28 +0000 Received: from localhost ([127.0.0.1]:46775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHvMd-0001ut-Kb for submit@debbugs.gnu.org; Sat, 20 Apr 2019 15:09:27 -0400 Received: from colin.muc.de ([193.149.48.1]:55703 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1hHvMb-0001uj-6S for 35347@debbugs.gnu.org; Sat, 20 Apr 2019 15:09:25 -0400 Received: (qmail 17272 invoked by uid 3782); 20 Apr 2019 19:09:20 -0000 Received: from acm.muc.de (p4FE151F0.dip0.t-ipconnect.de [79.225.81.240]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 20 Apr 2019 21:09:19 +0200 Received: (qmail 4519 invoked by uid 1000); 20 Apr 2019 19:09:19 -0000 Date: Sat, 20 Apr 2019 19:09:19 +0000 To: Dylan Johnson Subject: Re: bug#35347: CC Mode 5.33.2 (C++//l); An improper space is being added to the tabbing of a access specifier label inside of a class. Message-ID: <20190420190919.GA4044@ACM> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 35347 Cc: 35347@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 (-) Hello, Dylan. On Sat, Apr 20, 2019 at 11:50:25 -0600, Dylan Johnson wrote: > When you define a class with a macro between the ``class'' specifier and > the name of the class you will observe that the access labels ``public:'' > and ``private:'' are interpreted as a labels by the autoformatter > and an incorrect space is added to its tabbing. Attempts to correct this > with ``C - c C - o'' failed. > Here is an example: > \\\ > class TEST_MACRO Test_class > { > public: > Test_class(); > virtual ~Test_class(); > void method1(); > int member1(); > }; > \\\ I think you need to register "TEST_MACRO" as a "noise macro", i.e. one which takes up space, but has no syntactic significance. The best place for this is probably in a mode hook (either c++-mode-hook or c-mode-common-hook), and the Lisp code to do it will look something like: (defun dj-c-mode-common-hook () (push "TEST_MACRO" c-noise-macro-names) (c-make-noise-macro-regexps)) (add-hook 'c-mode-common-hook 'dj-c-mode-common-hook) . It's all explained in the fantastic manual, the CC Mode manual, on page "Noise Macros". Please let us know how well this works. If it doesn't work, then we've probably got a bug to fix. Thanks for the report! > Thanks, > Dylan > Emacs : GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5) > of 2019-04-13 > Package: CC Mode 5.33.2 (C++//l) > Buffer Style: gnu > c-emacs-features: (pps-extended-state col-0-paren posix-char-classes > gen-string-delim gen-comment-delim syntax-properties 1-bit) > current state: > ============== > (setq > c-basic-offset 2 > c-comment-only-line-offset '(0 . 0) > c-indent-comment-alist '((anchored-comment column . 0) (end-block space . 1) > (cpp-end-block space . 2)) > c-indent-comments-syntactically-p nil > c-block-comment-prefix "" > c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") (awk-mode . " -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 20 17:03:08 2019 Received: (at 35347) by debbugs.gnu.org; 20 Apr 2019 21:03:08 +0000 Received: from localhost ([127.0.0.1]:46875 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHx8e-0000Rk-1N for submit@debbugs.gnu.org; Sat, 20 Apr 2019 17:03:08 -0400 Received: from mail-lf1-f44.google.com ([209.85.167.44]:32899) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHx8b-0000RD-65 for 35347@debbugs.gnu.org; Sat, 20 Apr 2019 17:03:06 -0400 Received: by mail-lf1-f44.google.com with SMTP id j11so6337499lfm.0 for <35347@debbugs.gnu.org>; Sat, 20 Apr 2019 14:03:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=trhnHIj9XgxvG1UNC0KFE5RJaXXrXo5dsUUvFa5EoqU=; b=rC6kGouKMDrZcIg+c6GypGyALuO+EQbq3xX2Vz7qgrsZbw8mKeezxDhrRpEl6chX9m H40dm2Slk+xASHKemGh459LO1fq1wRcr35ZfNpQn/qbn+DRs6/zKWWFFLehlxH9ZXVej g+FtOw1dYRY+wyw36FbgWlyCfZ6r5WgqZ6HiVOOxsKzLtuA7Wd9K8NAyqdrSmbOvgnVV FiSbXh95qwP6ORhZAB0TX8Ikcr728PK1Nfbpilog7JbRWeGq7MO5HakwAmHM6MCP1UtD Q0ryZy4gCCkytGF5vVR5y/PdTgL+TNYX9BRO3Kn4EaQmGvm/6h2/sgDbeEp9YpwZaxHU bh3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=trhnHIj9XgxvG1UNC0KFE5RJaXXrXo5dsUUvFa5EoqU=; b=Kc9mtByylpfWeFoMNI4zoSEoIpizJInnZECE52uQgyPXUHc1jSXkYoowUBk1/vq4YV 4NV0ZuTRrF3cUtSjsr/sFfK8cyhyn73SE16Glw/rCWwYWaLjgR94Ba3SN4mVDLqSssMq Iks/sMtueYr+HfVqVmAThVAZlIOQ7R7Vu55gwsjqBN+f0tuUJDTCvOV+8sSo2jyUpPG9 cachr2IxBtEdtGVlZkMLj9a291MKzGxOc9Z594DB3jF2o42vphvXlhrzNWEnEZ56zd3d EiMuRGm2pS+UC7IwsWfhhjKwfM4u3RFwQEyxHWXydV5TybFA+5UoB02DxstMGEbLwQt7 mtcw== X-Gm-Message-State: APjAAAUipHBkc9pa3aLEYanT0xO0CH+Q3/7BkXhXgjKxgwyvb1hDAVJw tW9LtsnJ+0fYzS2rOKquYuIm6u10HUR4X04vUFnzZoDx X-Google-Smtp-Source: APXvYqx962CedoP1LFJR4tM7ru8EukJgYDlpypC8lPQyAlA3AlgTqnAMAk/UVx7zvKTyRcNMQ3+K6Flw9XZcBEYB2GY= X-Received: by 2002:ac2:42c8:: with SMTP id n8mr6292188lfl.28.1555794179192; Sat, 20 Apr 2019 14:02:59 -0700 (PDT) MIME-Version: 1.0 References: <20190420190919.GA4044@ACM> In-Reply-To: <20190420190919.GA4044@ACM> From: Dylan Johnson Date: Sat, 20 Apr 2019 15:02:47 -0600 Message-ID: Subject: Re: bug#35347: CC Mode 5.33.2 (C++//l); An improper space is being added to the tabbing of a access specifier label inside of a class. To: Alan Mackenzie Content-Type: multipart/alternative; boundary="00000000000064fd230586fc8f32" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35347 Cc: 35347@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 (-) --00000000000064fd230586fc8f32 Content-Type: text/plain; charset="UTF-8" Alan, I was not aware of this cc-mode feature. It resolved my issue. Thanks, Dylan On Sat, Apr 20, 2019 at 1:09 PM Alan Mackenzie wrote: > Hello, Dylan. > > On Sat, Apr 20, 2019 at 11:50:25 -0600, Dylan Johnson wrote: > > When you define a class with a macro between the ``class'' specifier and > > the name of the class you will observe that the access labels ``public:'' > > and ``private:'' are interpreted as a labels by the autoformatter > > and an incorrect space is added to its tabbing. Attempts to correct this > > with ``C - c C - o'' failed. > > > Here is an example: > > > \\\ > > > class TEST_MACRO Test_class > > { > > public: > > Test_class(); > > virtual ~Test_class(); > > void method1(); > > int member1(); > > }; > > > \\\ > > I think you need to register "TEST_MACRO" as a "noise macro", i.e. one > which takes up space, but has no syntactic significance. The best place > for this is probably in a mode hook (either c++-mode-hook or > c-mode-common-hook), and the Lisp code to do it will look something like: > > (defun dj-c-mode-common-hook () > (push "TEST_MACRO" c-noise-macro-names) > (c-make-noise-macro-regexps)) > (add-hook 'c-mode-common-hook 'dj-c-mode-common-hook) > > . It's all explained in the fantastic manual, the CC Mode manual, on > page "Noise Macros". > > Please let us know how well this works. If it doesn't work, then we've > probably got a bug to fix. > > Thanks for the report! > > > Thanks, > > > Dylan > > > > Emacs : GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version > 3.24.5) > > of 2019-04-13 > > Package: CC Mode 5.33.2 (C++//l) > > Buffer Style: gnu > > c-emacs-features: (pps-extended-state col-0-paren posix-char-classes > > gen-string-delim gen-comment-delim syntax-properties 1-bit) > > > current state: > > ============== > > (setq > > c-basic-offset 2 > > c-comment-only-line-offset '(0 . 0) > > c-indent-comment-alist '((anchored-comment column . 0) (end-block space > . 1) > > (cpp-end-block space . 2)) > > c-indent-comments-syntactically-p nil > > c-block-comment-prefix "" > > c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") (awk-mode . " > > -- > Alan Mackenzie (Nuremberg, Germany). > --00000000000064fd230586fc8f32 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Alan,

I was not aware o= f this cc-mode feature. It resolved my issue.=C2=A0

Than= ks,
Dylan



On Sat, Apr 20, 2019= at 1:09 PM Alan Mackenzie <acm@muc.de= > wrote:
Hell= o, Dylan.

On Sat, Apr 20, 2019 at 11:50:25 -0600, Dylan Johnson wrote:
> When you define a class with a macro between the ``class'' spe= cifier and
> the name of the class you will observe that the access labels ``public= :''
> and ``private:'' are interpreted as a labels by the autoformat= ter
> and an incorrect space is added to its tabbing. Attempts to correct th= is
> with ``C - c C - o'' failed.

> Here is an example:

> \\\

> class TEST_MACRO Test_class
> {
> public:
> Test_class();
> virtual ~Test_class();
> void method1();
> int member1();
> };

> \\\

I think you need to register "TEST_MACRO" as a "noise macro&= quot;, i.e. one
which takes up space, but has no syntactic significance.=C2=A0 The best pla= ce
for this is probably in a mode hook (either c++-mode-hook or
c-mode-common-hook), and the Lisp code to do it will look something like:
(defun dj-c-mode-common-hook ()
=C2=A0 (push "TEST_MACRO" c-noise-macro-names)
=C2=A0 (c-make-noise-macro-regexps))
(add-hook 'c-mode-common-hook 'dj-c-mode-common-hook)

.=C2=A0 It's all explained in the fantastic manual, the CC Mode manual,= on
page "Noise Macros".

Please let us know how well this works.=C2=A0 If it doesn't work, then = we've
probably got a bug to fix.

Thanks for the report!

> Thanks,

> Dylan


> Emacs : GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.2= 4.5)
> of 2019-04-13
> Package: CC Mode 5.33.2 (C++//l)
> Buffer Style: gnu
> c-emacs-features: (pps-extended-state col-0-paren posix-char-classes > gen-string-delim gen-comment-delim syntax-properties 1-bit)

> current state:
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> (setq
> c-basic-offset 2
> c-comment-only-line-offset '(0 . 0)
> c-indent-comment-alist '((anchored-comment column . 0) (end-block = space . 1)
> (cpp-end-block space . 2))
> c-indent-comments-syntactically-p nil
> c-block-comment-prefix ""
> c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") (= awk-mode . "

--
Alan Mackenzie (Nuremberg, Germany).
--00000000000064fd230586fc8f32-- From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 21 05:47:15 2019 Received: (at control) by debbugs.gnu.org; 21 Apr 2019 09:47:15 +0000 Received: from localhost ([127.0.0.1]:47725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hI947-0000mE-63 for submit@debbugs.gnu.org; Sun, 21 Apr 2019 05:47:15 -0400 Received: from colin.muc.de ([193.149.48.1]:47978 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1hI943-0000m3-2t for control@debbugs.gnu.org; Sun, 21 Apr 2019 05:47:12 -0400 Received: (qmail 68963 invoked by uid 3782); 21 Apr 2019 09:47:06 -0000 Received: from acm.muc.de (p2E5D5BDE.dip0.t-ipconnect.de [46.93.91.222]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 21 Apr 2019 11:47:05 +0200 Received: (qmail 5278 invoked by uid 1000); 21 Apr 2019 09:47:05 -0000 Date: Sun, 21 Apr 2019 09:47:05 +0000 To: control@debbugs.gnu.org Subject: Control message for bug 35347 Message-ID: <20190421094705.GA5249@ACM> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control 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 (-) tags 35347 + notabug close 35347 quit The OP's problem was fixed by the use of CC Mode's "noise macro" facility. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 21 06:06:51 2019 Received: (at 35347) by debbugs.gnu.org; 21 Apr 2019 10:06:51 +0000 Received: from localhost ([127.0.0.1]:47764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hI9N5-0003Kf-8u for submit@debbugs.gnu.org; Sun, 21 Apr 2019 06:06:51 -0400 Received: from colin.muc.de ([193.149.48.1]:65402 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1hI9N3-0003KU-Du for 35347@debbugs.gnu.org; Sun, 21 Apr 2019 06:06:49 -0400 Received: (qmail 85759 invoked by uid 3782); 21 Apr 2019 10:06:47 -0000 Received: from acm.muc.de (p2E5D5BDE.dip0.t-ipconnect.de [46.93.91.222]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 21 Apr 2019 12:06:46 +0200 Received: (qmail 5389 invoked by uid 1000); 21 Apr 2019 10:06:46 -0000 Date: Sun, 21 Apr 2019 10:06:46 +0000 To: Dylan Johnson Subject: Re: bug#35347: CC Mode 5.33.2 (C++//l); An improper space is being added to the tabbing of a access specifier label inside of a class. Message-ID: <20190421100646.GB5249@ACM> References: <20190420190919.GA4044@ACM> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 35347 Cc: 35347@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 (-) Hello again, Dylan. On Sat, Apr 20, 2019 at 15:02:47 -0600, Dylan Johnson wrote: > Alan, > I was not aware of this cc-mode feature. It resolved my issue. That's great to hear! I've closed the bug as "not a bug". But I do wonder whether some documentation for "noise macros" could be improved, somehow, maybe writing something about them somewhere where it would get read. Macros are a problem in the C/C++/... family, since they can expand to literally anything (including nothing), making it difficult to analyse their "syntax". Thanks again for the report! > Thanks, > Dylan -- Alan Mackenzie (Nuremberg, Germany). From unknown Mon Aug 18 14:21:59 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 19 May 2019 11: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