help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Convenient way to set "root of my project"?


From: Thierry Volpiatto
Subject: Re: Convenient way to set "root of my project"?
Date: Wed, 28 Jan 2009 08:49:51 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Brett Hoerner <bretthoerner@gmail.com> writes:

> I'd like for commands like "grep" and "find file" to open at the root
> of my "project" (I know emacs has no knowledge of projects).  Does
> anyone do / use something similar?
>
> For example, I'm in /foo/bar/blah/doo/woo/file and I M-x grep, it's
> based in /foo/bar/blah/doo/woo/ and I don't want to take the time to
> change the path every time - 99% of the time I want to search my
> current project (let's say /foo) for something.  Ditto for find-file,
> changes are the file I want isn't in /foo/bar/blah/doo/woo/, but
> somewhere further up the tree (and down another branch), I'd love to
> start at /foo.
>
> Ideas?  Or maybe I'm using both of these wrong and someone can tell me
> the proper emacs-foo?

You have to use the appropriate tool to do a recursive search
For grep it's the -r option.

Search the word "defun" in all my elisp dirs and subdirs:
,----
| (diredp-do-grep "grep -nHr -e defun   /home/thierry/elisp/icicles")
`----

==> 2 mn 11

But you can use more convenient tool like traverselisp.el.

M-x traverse-deep-rfind RET /home/thierry/elisp/icicles RET defun RET .el

==> 37 s

Faster but traverse is set to ignore all .hg, .svn etc...
You can set that as you want. (for files also)
Here it search only on .el files.

traverselisp is on emacswiki at:

http://www.emacswiki.org/cgi-bin/emacs/traverselisp.el
or
hg clone http://freehg.org/u/thiedlecques/traverselisp/ 

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France





reply via email to

[Prev in Thread] Current Thread [Next in Thread]