Indent macros as regular C code in emacs

Indenting macros as it were regular code, may cause confusion, since macros are not to be considered part of the code. Although, when programming with openmp and its directives (#pragma omp), it’s annoying to have they indented to the beginning of the line, specially because openmp directives may be nested.

So, to change indentation, add the following line to you .emacs configuration file:

(c-set-offset (quote cpp-macro) 0 nil)

Source: http://stackoverflow.com/questions/4669219/indent-preprocessor-directives-as-c-code-in-emacs

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s