Questions tagged [c]

is for C source code editing, completions, formatting, compiling, folding, searching, executing, syntax checking, debugging, and other modern IDE features that Emacs supports.

28 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
65 views

Working around preprocessor blocks

I am trying to navigate a C project that has lots of preprocessor directives like this: #ifdef SOME_COMPILE_TIME_VARIABLE for ( idx=0; idx<FOO; idx++ ) { #else for ( idx=0; idx<BAR; idx+...
3
votes
0answers
144 views

Turn C Electric Indentation off only for specific characters

Extending Customizing c-mode indentation behavior in emacs-24.4 How can electric indentation be disabled for other specific keys without disabling the entire mode? Specifically, how can electric ...
2
votes
0answers
90 views

Valgrind interface for emacs

Is there an interface similar to 'gdb-mi' for using Valgrind in emacs? What are some ways to use Valgrind inside emacs?
2
votes
0answers
94 views

How to modify behavior of syntax highlighting without editing the original source?

There is a bug in C/C++ comment highlighting (bug 11865) Where the fix appears to be to modify the value of c-font-lock-doc-comments Is there a way to do this in my emacs config, instead of having ...
1
vote
0answers
31 views

Is there a package that show the value of constant variables? C/C++

I would like some package that show the variable value when I put cursor on it. The behavior that I expect can be seen in the image below. The image below is in vscode, I would like some package that ...
1
vote
0answers
47 views

Align elements of a matrix to the right

I have a matrix in C++ Matrix<double> A = { {31, -13, 0, 0, 0, -10, 0, 0, 0}, {-13, 35, -9, 0, -11, 0, 0, 0, 0}, {0, -9, 31, -10, 0, 0, 0, 0, 0}, {0, 0, -10, 79, -30, 0, 0, 0, -...
1
vote
0answers
163 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
42 views

annotate C's function list static or not in Speedbar

Is there any way to configure Speedbar to tag functions in the buffer static or extern for C? If not, how can I make it?
1
vote
0answers
46 views

Parsing non-standard C with gtags

I'm working with a codebase that's meant to be built with a proprietary C compiler using tons of esoteric language extensions. Ideally, I'd like to stick to my chosen environment as much as possible, ...
1
vote
0answers
151 views

Is CEDET/semantic obsolete? How to analyze C code for source transformation tasks?

Reading through some CEDET docs I found that the author herself recommends "to use Semantic only as source of information, and perform names completion using other packages". Does this advice also ...
1
vote
0answers
106 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
98 views

Getting gdb to work for this project

For this project, I cannot seem to get M-x gdb to work in Emacs 25.1 (on Ubuntu 14.04.5 64-bit if it matters - this should be the case for any Ubuntu-based Linux in general I imagine). Steps to ...
1
vote
0answers
659 views

Why do “gnu” and “linux” `c-default-style` treat `c-basic-offset` differently?

These lines in my .emacs (setq-default indent-tabs-mode nil) (setq-default c-default-style "linux") (setq-default c-basic-offset 4) result in the following formatting of my c code (the c-basic-...
1
vote
0answers
123 views

Smarter compile in emacs

I often got to work with projects organized as follows: src/ include/ ... Makefile Is there a way to teach emacs' "compile" function to always use that top-level Makefile regardless which file I'...
1
vote
0answers
374 views

Code completion for C++

I have just started using emacs, after coming from using Xcode. I would like to get code completion for C++, however there are a whole bunch of things that don't really explain what they do (at least ...
1
vote
0answers
25 views

How can I have C functions coloured based on whether they are defined?

Colleague of mine showed me a cool feature of gnome-builder which does colour symbols based on whether they are defined or not and I was wondering whether it is possible in Emacs as well. And by that ...
0
votes
0answers
36 views

Stepping through c code in emacs

I am trying to step through code in emacs and am looking for a plugin which will displa the contents of an element when I hover over it. Is there any plugin like this currently? How do you step ...
0
votes
0answers
19 views

some pointer declarations not colored

macs -nw fails to color code certain declarations of pointer arrays seemingly depending on the structure being pointed to. For example: SomeStruct *one[4] is all white (I have dark background), but ...
0
votes
0answers
18 views

company is not showing popup complete in c/c++

This is my company config The problem is that with python or lisp when I start to type the popup is shown immediately, but in C/C++ this don't occur. However if I type C-n or C-p the completition is ...
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
0answers
30 views

Too much time spent for emacs to open cpp in the project

I use ggtags in order to improve my efficiency. I follow the manual to setup emacs environment. https://tuhdo.github.io/c-ide.html However, during editing the cpp files in the projects. Chance are ...
0
votes
1answer
107 views

CEDET semantic-complete-jump customization

When I search through project via semantic-complete-jump and tag is not unique (its defined in multiple places), I must hit <tab> to iterate through all possible places. Problem is, I horribly ...
0
votes
0answers
68 views

Performance issue of c-mode

When I'm pressing C-p/n moving the cursor around, the redisplaying is quite lagging. A profile of CPU give + command-execute 527 59% - ...
0
votes
0answers
200 views

How to toggle C/C++ multi-line comments using preprocessor `#if 0` … `#endif`?

Is it possible to configure C/C++ multi-line comments to comment/uncomment selected text using the preprocessor? eg: Before: // a comment Some(code); /* some comment */ After: #if 0 //...
0
votes
0answers
441 views

c/c++ disassembler for emacs and objdump

I'm trying to show assembly under the cursor in emacs (spacemacs, on mac os x) and although disaster.el does generate assembly with objdump, it fails to associate lines in source with lines in ...
0
votes
0answers
83 views

How to add a key map in Emacs source code?

I found ESC-prefix and Control-X-prefix defined in keymap.c: initial_define_key (global_map, 033, "ESC-prefix"); initial_define_key (global_map, Ctl ('X'), "Control-X-prefix"); But no matter what ...
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 ...
0
votes
0answers
512 views

Wrong indent in c-mode and c++-mode

In my coding style tabs used to indent and spaces for align. I've configure Emacs for this, but some times emacs places 4 spaces instead of tabulation in some blocks of code. If can be fixed by ...