I'm looking for an extension of emacs that automaticaly generate headers from source like C code.

I made a script for this in the past using awk. I put my source path and it generate a header with all the function prototypes.

I have look for something similar directly in emacs but when I search for "automatic header" it lead me to auto-insert or header2.

I noticed that ECB has a window for methods, is there a way to put it in a header automatically ? Or maybe another extension to do that task ?

  • This is not Emacs-specific, but you could try using ctags for this, see this SO answer: stackoverflow.com/a/1571136 for details.
    – wvxvw
    Nov 28 '15 at 21:17
  • I just tried it, it extract the good information but I don't know how to generate proper prototypes, not tags. I am googling but haven't find anything at the moment. Nov 28 '15 at 22:13
  • Unfortunately, there's no way to make it output the actual header, but with the info it generates you could put a lot less effort into writing a script to make it into a header. PS. I'm not sure which option does ECB use, but it's either ctags or Semantic output. I don't know Semantic enough to tell what function to call to get the contents of the outlines buffer, but I'd imagine that if you were willing to write some ELisp code to do that, then locating that function wouldn't be very difficult.
    – wvxvw
    Nov 29 '15 at 6:36

Try library header2.el. It is simple but useful. You can tweak it for your own needs and for particular languages.

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.