Gentoo Archives: gentoo-user

From: Nikos Chantziaras <realnc@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Recommend C source browser/editor?
Date: Sat, 07 Aug 2021 07:44:02
Message-Id: seldjn$21f$1@ciao.gmane.io
In Reply to: [gentoo-user] Recommend C source browser/editor? by Grant Edwards
1 On 06/08/2021 23:25, Grant Edwards wrote:
2 > Would anybody care to recommend a tool for browsing around (and
3 > editing) a tree of somebody-else's C code?
4 >
5 > I prefer emacs for day-to-day editing of my code (when I know what's
6 > where), but I'm looking for something to browse around a tree of
7 > unfamiliar source code and make minor changes. I briefly tried
8 > emacs+cscope at a few points in the past, but it just never worked
9 > very well.
10 >
11 > It would be nice to have something that I can just point at a tree of
12 > source files and not to have to spend a lot of time setting up a
13 > "project" or "workspace" or whatever...
14
15 If emacs has support for compilation databases (a
16 "compile_commands.json" file), then you can generate one. The easiest
17 way to do that is with dev-util/bear:
18
19 $ bear -- make -j16
20
21 This will build the project as usual, but a compile_commands.json file
22 will be generated in the current directory. Load that file into an
23 editor or IDE that supports compilation databases.