2

Currently I am using eclipse to browse cross compiled C source code. I don't have back end cross compiler to actually compile and build the code. But eclipse create source browse tree. I want to have similar setup in Emacs so that I can browse source code even though it may build or not.

2
  • I think irony (with clang backend) doesn't require code to compile, or has some reasonable tolerance to the point it's useful during work. Have you tried it?
    – wvxvw
    Commented Jun 23, 2016 at 15:25
  • 1
    Please define what you mean by "browse code" and "similar to Eclipse". I.e. clarify exactly what functionality you're looking for, which operations you'd like to be able to do, and how you want things to be presented.
    – Stefan
    Commented Oct 26, 2017 at 2:09

2 Answers 2

1

I could think of two solutions as of now, Speedbar mode - A separate frame pop-ups with the list of files/folders related to the current project. More Info (https://www.emacswiki.org/emacs/SpeedBar). Comes bundled with emacs. No extra tools needed.

GGtags mode - Generate tags for the project in the root directory, and navigate the source using M-., M-* etc. More Info (https://github.com/leoliu/ggtags). Needs to have gnu global/ctags installed but it is easy to setup.

1

For C developers, I suggest ctags.

The problem of GNU Gloal is that it treats the function declaration as reference. That's awkward if you want to check the declaration of function ONLY. C++ code does not have this issue because function is always inside class/struct.

You can use https://github.com/redguardtoo/counsel-etags which provides everything you need for code navigation using ctags/etags.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.