Questions tagged [cc-mode]

Major mode for C, C++, Objective-C, Java, CORBA IDL, Pike, AWK. Included in GNU Emacs and XEmacs.

Filter by
Sorted by
Tagged with
6
votes
3answers
759 views

Customizing c-mode indentation behavior in Emacs 24.4

Before Emacs 24.4, indentation in c-mode happened after typing things like ;, , and so on and I like this behavior. But in Emacs 24.4, c-mode also indents on RET. This causes a lot of problems for me ...
8
votes
1answer
399 views

formatting constexpr if in c++-mode

I recently started using C++17, which brings constexpr if. This however screws up c++-modes default indentation. // emacs 25.3.2 with --no-init if constexpr (n == 1) { // Why? } else if ...
3
votes
1answer
92 views

Update cc-style to use a mix of tabs and spaces, depending on context?

I'm looking for a way to mix tabs and spaces in my cc-styles. Whilst I question the sanity of this coding style, and wouldn't ever choose to use it had I the choice (seems other people share my view),...
4
votes
2answers
671 views

CC-Mode - Javadoc Comment Colors in C/C++

I've been fiddling around a bit with CC-mode lately and figured that since I prefer to comment my functions/classes with javadoc-like syntax, I'd like to use the built-in comment highlighting provided ...
6
votes
2answers
934 views

Change the way CC-mode font-lock the C++11 `auto` syntax

With C++11, the keyword auto attained a new syntax and semantics. However, it seems that CC-mode has not been aware of this. For example, if I write auto var = exp, I get var in green, in which ...
2
votes
2answers
278 views

Create new major mode from cc-mode that allows comments with two dashes

It is possible and relatively easy to create a new major mode, deriving from c-mode, and just add two dashes '--' to work as comments too? I have checked many resources, but couldn't find anything ...
1
vote
2answers
96 views

Stop reindenting `if` after `else`

Given the file test.c: int main() { if (a) foo(); else if (b) // line 6 bar(); else baz(); } Whenever a comma or paren is typed while point is on line 6 (...
0
votes
1answer
241 views

Setup c-mode indentation, braces and tabs

I've been trying to setup cc-mode based files to behave in the way I want, but with so many varying opinions and suggested ways of doing things, I've not been able to get things just right. All I ...