From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sam Steingold Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r99848: (compilation-save-buffers-predicate): Date: Mon, 12 Apr 2010 16:02:32 -0400 Message-ID: <4BC37C58.1030306@gnu.org> References: <4BBF536E.4090702@gnu.org> <87r5ml3icx.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1271102579 1385 80.91.229.12 (12 Apr 2010 20:02:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 12 Apr 2010 20:02:59 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 12 22:02:58 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O1PqT-0002Cx-LY for ged-emacs-devel@m.gmane.org; Mon, 12 Apr 2010 22:02:57 +0200 Original-Received: from localhost ([127.0.0.1]:34304 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1PqS-0001RK-SR for ged-emacs-devel@m.gmane.org; Mon, 12 Apr 2010 16:02:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O1PqE-0001Mh-3r for emacs-devel@gnu.org; Mon, 12 Apr 2010 16:02:42 -0400 Original-Received: from [140.186.70.92] (port=52474 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1PqC-0001Lh-4o for emacs-devel@gnu.org; Mon, 12 Apr 2010 16:02:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O1Pq7-0006nG-1v for emacs-devel@gnu.org; Mon, 12 Apr 2010 16:02:39 -0400 Original-Received: from mx2.janestreet.com ([38.105.200.115]:38912 helo=mx1.janestreet.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1Pq6-0006mx-Uo for emacs-devel@gnu.org; Mon, 12 Apr 2010 16:02:35 -0400 Original-Received: from nyc-qsv-mail1.delacy.com ([172.25.22.57]) by mx1.janestreet.com with esmtp (Exim 4.71) (envelope-from ) id 1O1Pq4-0006GW-Pb for emacs-devel@gnu.org; Tue, 13 Apr 2010 00:02:32 +0400 Original-Received: from nyc-qws-005.delacy.com ([172.25.131.105]) by nyc-qsv-mail1.delacy.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.71) (envelope-from ) id 1O1Pq4-0001uw-NA; Mon, 12 Apr 2010 16:02:32 -0400 User-Agent: Thunderbird 2.0.0.24 (X11/20100318) In-Reply-To: X-Enigmail-Version: 0.95.6 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:123538 Archived-At: Stefan Monnier wrote: >>>>>> - I like where this is going, but I'm not sure this is enough. >>>>>> Could you explain how you see it being used? >>>>>> if you edit a huge file which is expensive to save, you do not want it >>>>>> to be saved whenever you start a compilation elsewhere. >>>>> ;-) that part I understand of course. >>>>> But I mean what value do you expect users to use it with? >>>>> Would they globally set it to save one particular directory of theirs? >>>>> What if they have more than one project? >>>> this is problematic because compile does not announce what it's working >>>> directory is. >>> Any reason why we can't fix that? >> no, and here is a solution: > > I don't understand. You're saying there's no reason why we can't fix it > and then you go ahead and point me to a workaround. Maye we're not > talking about the same thing. By "announce what it's working dir is" > I mean "make sure default-directory has the proper value". > > Introducing `compile-default-directory' is not the end of the world, but > to my naive eyes, if `default-directory' doesn't point to the right > place, it's a bug to be fixed. default-directory "Automatically becomes buffer-local when set in any fashion" this means that it is useless in compilation-save-buffers-predicate because that is called inside the buffer to be saved and thus for it default-directory should be the directory where the buffer is located. >>> How 'bout this: >>> - we provide some way for the user to explain to compile.el how to find >>> her projects's root directories (e.g. a list of tell-tale file names). >> this is tricky: some files might be ordinary for some projects and the >> tell-tale for others. > > I know, that's a significant problem, but I can't think of a really good > solution other than push it onto the user by providing a customizable > variable. My main goal here is to make sure that we can support the > case where the user has several projects, which seems like a common > enough case, especially for Free Software hackers. I think this variable should be buffer-local (with an eye on being set in dir_locals). >>> - and we can also provide an option to "cd to project's root before >>> running the command". >> I doubt the value of this. > > I've used several build systems where this is necessary (e.g. a single > Makefile at the root, or something equivalent). I usually work around > it with something like M-x compile RET cd ..; make RET, but if `compile' > could insert the "cd .." for me when needed it would be even better. this sounds like a case for yet another buffer-local variable - build-directory > >>> How does that sound? >> fine. >> gonna do it? > > ;-) > > > Stefan > > > PS: We're talking here mostly about designing a good default value for > your new variable, right? Or if not default, at least a value that can > be listed in the possible options so the end user doesn't have to write > her own predicate function. > > >