Does anybody know how to inhibit emacs from indenting the name of functions or classes after a template clause?
Currenty the result is:
template <typename T>
class A {
/* ... */
};
where I would like to have:
template <typename T>
class A {
/* ... */
};
Thank you very much for your help.
EDIT 1 I'm using c++-mode with java as indent style for c++. I customized the c-offset-alist in this way:
(custom-set-variables
;;
'(c-offsets-alist (quote ((case-label . +) (innamespace . 0))))
Go to the class
line and hit TAB
to perform the (unsolicited) indentation.
Then press Control-CControl-Oto display the indent mode for
topmost-intro-cont`
Press ENTER
, then you can change the indent number (3 to 0 for instance).
At the end of your .emacs
you can set permanently that instruction:
(c-set-offset 'topmost-intro-cont 0 nil)
There are different styles for indentation for Emacs' C++ mode. Quoting EmacsWiki:
A partial list of the better known C styles:
The c-default-style
variable is what you need to change. Perhaps one of them will be what you need. Don't have Emacs right now, so I can't check them out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With