Using Emacs for big big projects

2019-03-09 11:39发布

Maybe is a often repeated question here, but i can't find anything similar with the search. The point is that i like to use Emacs for my personal projects, usually very small applications using C or python, but i was wondering how to use it also for my work, in which we have project with about 10k files of source code, so is veeeery big (actually i am using source insight, that is very nice tool, but only for windows), questions are:

  • Searching: Which is the most convenient way to search a string within the whole project?
  • Navigating throught the function: I mean something like putting the cursor over a function, define, var, and going to the definition
  • Refactoring

Also if you have any experience with this and want to share your thoughts i will consider it highly interesting.

Br

8条回答
SAY GOODBYE
2楼-- · 2019-03-09 11:43

There is also the Emacs Code Browser. It makes exploring projects a lot simpler. See here and here for more information.

查看更多
女痞
3楼-- · 2019-03-09 11:53

The "traditional" way of navigating C source files is to use "etags" to make a file called TAGS, then use ALT-. to go to functions across files.

For searching for strings in files, I usually use "grep". You could make a shell script with all the directories you want to search or something if you get tired of typing them in each time.

查看更多
【Aperson】
4楼-- · 2019-03-09 11:54

There are many ways that Icicles can help with projects. Likewise, Bookmark+ and even Dired+.

These libraries can help you create, organize, and manage projects, wherever their files and directories might reside. And they can help you navigate and search in various ways.

Some of the features are unique -- quite different from other approaches. I could list some of the project support here, but this is the best place to start.

查看更多
SAY GOODBYE
5楼-- · 2019-03-09 11:56

ECB is too heavyweight for my taste. I have had good results with xcscope. Needless to say it doesn't help too much with Python.

http://www.emacswiki.org/emacs/CScopeAndEmacs

查看更多
看我几分像从前
6楼-- · 2019-03-09 11:57

look to EDE from CEDET - it provide base support for projects...

查看更多
Melony?
7楼-- · 2019-03-09 12:04

In addition to using TAGS as others have mentioned, I find igrep and igrep-find very useful. There is also Emacs' built in grep and grep-find, but I find their interface more clumsy.

My standard search is:

M-x igrep-find some_regexp RET ~/work_area/*.cxx

Which will look for all *.cxx files under ~/work/area, and show results matching some_regexp. Like all the search utilities, it populates a compilation-like buffer you can navigate using C-x ` (aka M-x next-error).

查看更多
登录 后发表回答