From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Convenient way to set "root of my project"? Date: Tue, 27 Jan 2009 23:11:36 -0800 Message-ID: <00da01c98117$a8d5e1f0$0200a8c0@us.oracle.com> References: <43f72653-1412-4402-8074-ef5302ab07a0@35g2000pry.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1233126751 24974 80.91.229.12 (28 Jan 2009 07:12:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 28 Jan 2009 07:12:31 +0000 (UTC) To: "'Brett Hoerner'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 28 08:13:44 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LS4cD-0002nu-9r for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Jan 2009 08:13:37 +0100 Original-Received: from localhost ([127.0.0.1]:51450 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LS4av-0001dj-4g for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Jan 2009 02:12:17 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LS4aS-0001dM-1t for help-gnu-emacs@gnu.org; Wed, 28 Jan 2009 02:11:48 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LS4aP-0001cq-6C for help-gnu-emacs@gnu.org; Wed, 28 Jan 2009 02:11:47 -0500 Original-Received: from [199.232.76.173] (port=38391 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LS4aP-0001cn-3I for help-gnu-emacs@gnu.org; Wed, 28 Jan 2009 02:11:45 -0500 Original-Received: from acsinet11.oracle.com ([141.146.126.233]:59606) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LS4aN-00009b-W1 for help-gnu-emacs@gnu.org; Wed, 28 Jan 2009 02:11:44 -0500 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by acsinet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n0S7DUNG022443 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 28 Jan 2009 07:13:32 GMT Original-Received: from acsmt702.oracle.com (acsmt702.oracle.com [141.146.40.80]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n0S7BYg7007378; Wed, 28 Jan 2009 07:11:35 GMT Original-Received: from dradamslap1 (/141.144.161.13) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 28 Jan 2009 07:11:33 +0000 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcmA2xjbqmDbjlD2SgWB2lhe77X52AAO8PEg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 In-Reply-To: <43f72653-1412-4402-8074-ef5302ab07a0@35g2000pry.googlegroups.com> X-Source-IP: acsmt702.oracle.com [141.146.40.80] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090209.49800527.00D8:SCFSTAT928724,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:61714 Archived-At: > 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.