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: Working with different projects in Emacs Date: Wed, 8 Apr 2009 11:44:08 -0700 Message-ID: <005c01c9b87a$01a63340$c2b22382@us.oracle.com> References: <47a330c50904080550s4e5f2b3ck43b765fc2b7cd802@mail.gmail.com> <002301c9b863$0aa35840$c2b22382@us.oracle.com> <47a330c50904081121y506d6105s649b49692991421e@mail.gmail.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 1239216765 20207 80.91.229.12 (8 Apr 2009 18:52:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Apr 2009 18:52:45 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "'Damian'" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 08 20:54:03 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 1LrcuE-0007V5-HN for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Apr 2009 20:53:50 +0200 Original-Received: from localhost ([127.0.0.1]:43104 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lrcsq-0005cB-7f for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Apr 2009 14:52:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lrcl5-0002nd-RC for help-gnu-emacs@gnu.org; Wed, 08 Apr 2009 14:44:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lrcl1-0002mH-2E for help-gnu-emacs@gnu.org; Wed, 08 Apr 2009 14:44:23 -0400 Original-Received: from [199.232.76.173] (port=42873 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lrcl0-0002mA-KC for help-gnu-emacs@gnu.org; Wed, 08 Apr 2009 14:44:18 -0400 Original-Received: from rcsinet12.oracle.com ([148.87.113.124]:17725 helo=rgminet12.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lrcl0-0005Yn-4R for help-gnu-emacs@gnu.org; Wed, 08 Apr 2009 14:44:18 -0400 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rgminet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n38Ii1YO022982; Wed, 8 Apr 2009 18:44:02 GMT Original-Received: from acsmt706.oracle.com (acsmt706.oracle.com [141.146.40.84]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n38IiHuX031260; Wed, 8 Apr 2009 18:44:18 GMT Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 08 Apr 2009 18:44:09 +0000 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <47a330c50904081121y506d6105s649b49692991421e@mail.gmail.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 Thread-Index: Acm4dyIhuPsToVVZRDSiFM4vBX5hKAAACOMA X-Source-IP: acsmt706.oracle.com [141.146.40.84] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090205.49DCF07C.018D:SCFMA4539814,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:63586 Archived-At: > > If all of the files for a given project are in or under the > > same directory, then moving (e.g. `cd') to that directory > > should let you complete file names there. > > IOW, `M-x cd', which sets `default-directory', which is the > > directory, by default, for file-name completion. > > > > And you can easily write a command that takes you directly > > to your project directory, so you don't have to enter it each time. > > The problem I have with this solution, is that if I open a file in > some other directory, the working directory is changed again :( Only for the buffer of that file. The `default-directory' for the other buffers (including, e.g. a Dired buffer) would stay the same. I don't quite see the problem - perhaps you could describe a usage scenario in a little more detail. > > If the files of a project are in multiple directories, then > > you can use Dired, passing it the file list explicitly. > > Then mark specific files in that Dired buffer and then act > > on the marked files. > > And here it seems like one has to perform a lot of steps just to get > the autocompletion of the files for a project. But probably I'm not > getting it right A Dired buffer can have files from multiple directories, and those file names can be absolute. Example: M-: (dired '("my project" "/path/to/file1.c" "/other/path/to/file2.c")) You can then access those files directly in Dired, and you can mark them and operate on the marked files. You can also include subdirectories in a Dired listing (using `i'). But yes, the `default-directory' for the Dired buffer won't be appropriate for completing all of the file names, if the files are from different directories. No single `default-directory' is adequate to that task. ;-) But once you're visiting file A, you can complete to other files in the same directory as A - visiting A changes `default-directory' appropriately. If you are already aware of these things, and they don't provide what you need, then try describing the need in a little more detail.