all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: help-gnu-emacs@gnu.org
Subject: Re: C-mode: how to ignore certain tokens (sometimes)
Date: Mon, 29 Dec 2014 18:21:36 +0000 (UTC)	[thread overview]
Message-ID: <m7s63g$2h11$1@colin.muc.de> (raw)
In-Reply-To: mailman.16744.1419626453.1147.help-gnu-emacs@gnu.org

Hello, ?scar.
?scar Fuentes <ofv@wanadoo.es> wrote:
> One common idiom in C++ is

> class DECORATION foo {
> ...

> where DECORATION acts as an attribute to be applied to the class being
> defined. One example is __dllexport (Windows) or __attribute__
> ((visibility("default"))) (GNU/Linux). Usually it is a macro that
> expands to some compiler/platform-specific decoration.

> The problem is that the presence of DECORATION confuses C-mode and it
> makes bad guesses of some of the elements. For instance:

> struct EXPORT foo {
> public:
>  foo(int d)
>    : data()
>    {}

> The colon that precedes `data' is interpreted as `statement-cont' when
> it should be `member-init-intro'.

> It there a way to tell C-mode that certain tokens should be ignored
> while doing the analysis required by the indentation engine?

Not at the moment, no.  I have a half-tested enhancement "noise macros"
to CC Mode, a bit like the existing "macros with semicolons", designed to
address precisely this problem.  I foresee releasing it early in 2015.

Have a happy New Year!

-- 
Alan Mackenzie (Nuremberg, Germany).



       reply	other threads:[~2014-12-29 18:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.16744.1419626453.1147.help-gnu-emacs@gnu.org>
2014-12-29 18:21 ` Alan Mackenzie [this message]
2014-12-29 23:44   ` C-mode: how to ignore certain tokens (sometimes) Óscar Fuentes
2014-12-26 20:40 Óscar Fuentes

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

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

  git send-email \
    --in-reply-to='m7s63g$2h11$1@colin.muc.de' \
    --to=acm@muc.de \
    --cc=help-gnu-emacs@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.