Daniel M.
Daniel M.

Reputation: 669

Using Emacs for big big projects

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:

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

Br

Upvotes: 15

Views: 5013

Answers (8)

Drew
Drew

Reputation: 30701

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.

Upvotes: 2

daladd
daladd

Reputation: 86

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

Upvotes: 3

user181548
user181548

Reputation:

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.

Upvotes: 10

offby1
offby1

Reputation: 6983

My projects typically live in git, so I put this together to quickly search them:

;; There's something similar (but fancier) in vc-git.el: vc-git-grep
;; -I means don't search through binary files
(defcustom git-grep-switches "--extended-regexp -I -n --ignore-case"
  "Switches to pass to `git grep'."
  :type 'string)

(defun git-grep (command-args)
  (interactive
   (list (read-shell-command "Run git-grep (like this): "
                             (format "git grep %s -e "
                                     git-grep-switches)
                             'git-grep-history)))
  (let ((grep-use-null-device nil))
    (grep command-args)))

Upvotes: 9

Trey Jackson
Trey Jackson

Reputation: 74430

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).

Upvotes: 2

Roberto Aloi
Roberto Aloi

Reputation: 30985

Regarding searches in the whole project, I find extremely useful the rgrep command.

Also, imenu is quite handy to jump to a function definition in the same file.

These are my 2p.

Upvotes: 4

pmr
pmr

Reputation: 59811

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

Upvotes: 6

Alex Ott
Alex Ott

Reputation: 87119

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

Upvotes: 3

Related Questions