From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#42581: Wrong C++ indentation when using class MY_DLL_EXPORT_MACRO foo Date: 28 Jul 2020 18:38:05 -0000 Organization: muc.de e.V. Message-ID: <20200728183805.41537.qmail@mail.muc.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11460"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: tin/2.4.4-20191224 ("Millburn") (FreeBSD/11.3-RELEASE-p9 (amd64)) Cc: 42581@debbugs.gnu.org, acm@muc.de To: Stephane A Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 28 20:41:34 2020 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 1k0UXd-0002sZ-JR for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Jul 2020 20:41:33 +0200 Original-Received: from localhost ([::1]:42476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k0UXc-0004mD-H3 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Jul 2020 14:41:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k0UVC-00014N-Cd for bug-gnu-emacs@gnu.org; Tue, 28 Jul 2020 14:39:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47571) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k0UVC-0005e7-0G for bug-gnu-emacs@gnu.org; Tue, 28 Jul 2020 14:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k0UVB-0008AD-Ul for bug-gnu-emacs@gnu.org; Tue, 28 Jul 2020 14:39:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Jul 2020 18:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42581 X-GNU-PR-Package: emacs Original-Received: via spool by 42581-submit@debbugs.gnu.org id=B42581.159596149631326 (code B ref 42581); Tue, 28 Jul 2020 18:39:01 +0000 Original-Received: (at 42581) by debbugs.gnu.org; 28 Jul 2020 18:38:16 +0000 Original-Received: from localhost ([127.0.0.1]:59117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k0UUR-00089C-ME for submit@debbugs.gnu.org; Tue, 28 Jul 2020 14:38:15 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:58396 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1k0UUO-00088v-Ay for 42581@debbugs.gnu.org; Tue, 28 Jul 2020 14:38:14 -0400 Original-Received: (qmail 41538 invoked by uid 3782); 28 Jul 2020 18:38:05 -0000 In-Reply-To: X-Newsgroups: gnu.emacs.bug 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" Xref: news.gmane.io gmane.emacs.bugs:183627 Archived-At: In article you wrote: > [-- text/plain, encoding quoted-printable, charset: UTF-8, 41 lines --] > Hello, > Thank you for the advice :) I didn't know this one. > We have on *_EXPORT macro per module. So I would need to configure nois= e > macros by regexp. > I found *c-make-noise-macro-regexps *in the Emacs documentation > > but don't know how to set it up in my emacs file > since the syn= tax > is not documented. The syntax and semantics or regular expressions are documented thoroughly in the Emacs Lisp manual (elisp.info). The mechanics of the CC Mode hooks are similarly described in the CC Mode manual (ccmode.info). c-noise-macro-names can be either a list of strings (one of which would be "MY_EXPORT_DLL_MACRO") or just a regular expression, which you seem to need here. There is an example .emacs file in an appendix to the CC Mode manual. > I though of adding a call to the c++-mode-hook > . The c++-mode-hook would be an excellent place to make this setting, yes. > Regards, > St=C3=A9phane > On Tue, Jul 28, 2020 at 4:31 PM Eli Zaretskii wrote: >> > From: Stephane A >> > Date: Tue, 28 Jul 2020 13:34:43 +0200 >> > >> > There is a C++ indentation problem when using: >> > class MY_EXPORT_DLL_MACRO foo { >> > // with a >> > public: >> > foo(); // This line is not indented >> > // section. >> > }; >> > >> > The problem is not reproduced if, either: >> > >> > * the "MY_DLL_EXPORT_MACRO" is removed; or >> > * the "public:" section is removed >> >> Does it help to add MY_DLL_EXPORT_MACRO to the list in >> c-noise-macro-names? >> --=20 Alan Mackenzie (Nuremberg, Germany).