all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

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.