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: Drew Adams
Subject: RE: Convenient way to set "root of my project"?
Date: Tue, 27 Jan 2009 23:11:36 -0800

> 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?

Sounds similar to the recent thread "build a macro that opens a directory and
prompts for file name" - see that for suggestions. In particular, see Emacs
command `cd' and variable `default-directory'. 

Also, in `grep', without using `cd' to change the `default-directory', you can
change the target files using prefix `../' - that's a quick way to do a one-off
search in the parent directory. You can do things like `grep foo ../../*.el
../*.el *.el */*.el', etc. Same thing applies for `find-file': you can type
`../' etc. after the default directory shown in the minibuffer.





reply via email to

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