GNU bug report logs -
#42581
Wrong C++ indentation when using class MY_DLL_EXPORT_MACRO foo
Previous Next
Reported by: Stephane A <a.stephane.fsw <at> gmail.com>
Date: Tue, 28 Jul 2020 14:04:02 UTC
Severity: normal
Tags: moreinfo
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
In article <mailman.208.1595954047.2739.bug-gnu-emacs <at> 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 <at> gnu.org> wrote:
>> > From: Stephane A <a.stephane.fsw <at> 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).
This bug report was last modified 3 years and 122 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.