简体   繁体   中英

Emacs Auto-include in C

When using java and eclipse, there is a button to automatically include whatever standard libraries need to be included. Is there any analogous option for C and emacs to save me the effort of writing out includes from standard library?

Unfortunately, I don't think so. In general a feature like that requires the ability to fully parse C code and the only part of Emacs that can do that is CEDET. CEDET has a lot of infrastructure for adding features, so this would be the place to look.

However, C's lack of namespaces would make building something like that very error prone. Often most includes are application specific anyway, so I can't see something restricted to the stdlib be incredibly useful.

You can save yourself some typing with yas-snippets , but that is still a long way from auto-magically figuring out your includes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM