unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* C-mode: how to ignore certain tokens (sometimes)
@ 2014-12-26 20:40 Óscar Fuentes
  0 siblings, 0 replies; 3+ messages in thread
From: Óscar Fuentes @ 2014-12-26 20:40 UTC (permalink / raw)
  To: help-gnu-emacs

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?




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-29 23:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.16744.1419626453.1147.help-gnu-emacs@gnu.org>
2014-12-29 18:21 ` C-mode: how to ignore certain tokens (sometimes) Alan Mackenzie
2014-12-29 23:44   ` Óscar Fuentes
2014-12-26 20:40 Óscar Fuentes

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).