unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Stephane A <a.stephane.fsw@gmail.com>
Cc: 42581@debbugs.gnu.org, acm@muc.de
Subject: bug#42581: Wrong C++ indentation when using class MY_DLL_EXPORT_MACRO foo
Date: 28 Jul 2020 18:38:05 -0000	[thread overview]
Message-ID: <20200728183805.41537.qmail@mail.muc.de> (raw)
In-Reply-To: <mailman.208.1595954047.2739.bug-gnu-emacs@gnu.org>

In article <mailman.208.1595954047.2739.bug-gnu-emacs@gnu.org> 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 noise
> macros by regexp.

> I found *c-make-noise-macro-regexps *in the Emacs documentation
> <https://www.gnu.org/software/emacs/manual/html_node/ccmode/Noise-Macros.html>
> but don't know how to set it up in my emacs file
> <https://github.com/astephane/emacs/blob/master/emacs.el> since the syntax
> 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
> <https://github.com/astephane/emacs/blob/master/emacs.el#L245>.

The c++-mode-hook would be an excellent place to make this setting, yes.

> Regards,

> Stéphane


> On Tue, Jul 28, 2020 at 4:31 PM Eli Zaretskii <eliz@gnu.org> wrote:

>> > From: Stephane A <a.stephane.fsw@gmail.com>
>> > 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?
>>

-- 
Alan Mackenzie (Nuremberg, Germany).






  parent reply	other threads:[~2020-07-28 18:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-28 11:34 bug#42581: Wrong C++ indentation when using class MY_DLL_EXPORT_MACRO foo Stephane A
2020-07-28 14:31 ` Eli Zaretskii
2020-07-28 16:06   ` Stephane A
     [not found] ` <mailman.208.1595954047.2739.bug-gnu-emacs@gnu.org>
2020-07-28 18:38   ` Alan Mackenzie [this message]
     [not found]     ` <CA+Q2SshAeQD_gN+dC3U8FEdf1xVB2GTpObK=vjC6fn-Ox=_w6A@mail.gmail.com>
2020-07-31 19:44       ` Alan Mackenzie
2020-08-03  9:30         ` Stephane A
2020-08-14  8:01           ` Stephane A
2021-12-05  1:03             ` Lars Ingebrigtsen
2022-01-21 13:38               ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200728183805.41537.qmail@mail.muc.de \
    --to=acm@muc.de \
    --cc=42581@debbugs.gnu.org \
    --cc=a.stephane.fsw@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).