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.

  • 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 Jun 23 '16 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 Oct 26 '17 at 2:09
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, privacy policy and cookie policy

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