MSVC visual c++ allows you to right click on an #include directive header file (.h) and select to "open document". This makes browsing source code a breeze as it turns an entire source code tree basically into a hyperlinked website. Is this convenience available with emacs? Is there another apparatus that allows browsing source code, any code you write, any project create, so automatically? Does Xcode have it? Does eclipse? Does anything?
Asked
Active
Viewed 2,358 times
2 Answers
7
C-c C-o, which runs the command ff-find-other-file
, is what you are looking for. It will open the included file when the point is on the #include
line.
Googling for emacs code browsing
also reveals
-
Yes. And Xcode has open "callee/caller" and vim has something called typing gd but cedet is applicable to it. And eclipse has 'open declarations' and code::blocks has 'open header file'. I think MSVC and windows are going to be clicked into the trash bin. – user108754 Apr 07 '13 at 06:57
0
You can use semantic Smart Jump, move the cursor to the #include line, then execute command semantic-ia-fast-jump
, this command is usually used to jump to symbols, it can also jump to include file.
As a precondition to use semantic-ia-fast-jump
, you need manage you code in an ede project, here is an example for C/C++ project
suppose your directory structure like this:
~/myproject/
|-include/test.h
|-src/test.c
|-Makefile
and your ede project configuration
(ede-cpp-root-project "MyProject"
:file "~/myproject/Makefile"
:include-path '( "/include" )
:system-include-path '( "/usr/include/mysql/" )
test.c
#include <mysql.h>
#include "test.h"
Now, move your cursor to either of the two line in test.c, run semantic-ia-fast-jump

xiaobing
- 378
- 4
- 16