Questions tagged [cc-mode]

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

16 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8
votes
1answer
158 views

Custom indentation for specific lines?

I currently try to figure out, how I can handle some lines specifically without messing up the indentation of the rest of the buffer. Consider the following function MyFunc as an example: void MyFunc(...
4
votes
0answers
2k views

Support C++11 syntax in c++-mode

I want correct indentation with my C++ code. The following piece of code indents properly. It nicely indents the access label and the member declaration independently. class Test : public Base { ...
2
votes
0answers
23 views

Derived mode from CC Mode: how do I write one?

Where is the definitive, up-to-date guide on how to write a derived mode from CC Mode. I have a mode that's malfunctioning and thought I might just rewrite it, but information I find is spotty and ...
2
votes
0answers
180 views

How to set indentation style substatement-open offset parameter from .dir-locals.el?

Within CC mode, for C and C++ files inside a directory, I'd like to have the open braces following a case/do/for/if/while not indented, whatever the style is and without having to change anything in ....
2
votes
0answers
50 views

Is it possible to detect C/C++/Java variable declarations.?

I'm writing a minor mode to handle automatic spacing of operator characters, but I'm having some trouble with C/C++. The problem is that I can't figure out how to tell in general whether a * is a ...
1
vote
0answers
37 views

Enable `cc-mode` documentation highlightning per minor mode

I am writing a minor mode for enabling support for JML within Java files. I realized the syntax highlighting with cc-mode's support for documentation comments. It works if I set c-doc-comment-style ...
1
vote
0answers
161 views

Is this a c-default-style? If not, how can i configure it?

I've just started using spacemacs and the docstrings for cc-styles are a bit daunting. I've also just started working on a new project in c, and would like to keep consistent with existing style: ...
1
vote
0answers
102 views

Structures are defined using a macro, flycheck gives errors

In our source code we surround structures with a macro (MKDIFF) that serves as a flag for the Makefile system. It does not expand into anything, just a flag. Flycheck (understandably) flags these ...
1
vote
0answers
324 views

Emacs as environment for iOS development

Is there any modes which may improve development experience for nowadays ObjC (syntax highlight for method calls, properties, blocks, literals, lightweight generics, modern keywords)? Ideally with ...
1
vote
0answers
438 views

c-indent-line-or-region: Variable binding depth exceeds max-specpdl-size

I'm trying to define a new major mode using define-generic-mode and want to try reusing c-indent-line-or-region for my indent-line-function. I've inserted (set (make-local-variable 'indent-line-...
1
vote
0answers
88 views

How does forward-list work for “<>” in c++-mode?

I am trying to understand how forward-list matches template delimiters <> in c++-mode. forward-list in lisp.el calls scan-lists with the appropriate arguments. The documentation for scan-lists ...
0
votes
0answers
23 views

`scad-mode` (derived from CC Mode) hangs Emacs. How to debug/fix?

I have found that scad-mode.el, a derived mode from CC Mode, which can be found here: https://github.com/openscad/openscad/blob/master/contrib/scad-mode.el hangs emacs if I type #( into the window,...
0
votes
0answers
10 views

cmake-ide in projects with only make

What are my options to mimic cmake-ide in the projects that are not built with CMake? The features that I want the most are find-definition and autocomplete. For the compilation related features, ...
0
votes
1answer
23 views

How do I suppress indentation after labels in Groovy?

I'm writing some Groovy code, and in my unit tests I have something like the following: def testFoo(){ given: //setup statement 1 //setup statement 2 //... when: //Execute ...
0
votes
2answers
343 views

prevent auto indent temporarily for multi line conditional, loops, etc

When I am writing in c-mode, I prefer to write multi-line control statements in the following way. if( cond1 && cond2 || cond3 ) { /* stuff */ } for( i = 0; i < N; ++i ) { ...
0
votes
0answers
85 views

Make Helm Projectile to show external sources

I'm pretty new to emacs (was using Vim), primarily using it for Ruby on Rails projects. At my free time, I like to write some C code for STM32 micro-controllers. Unlike RoR project, C project for ...