From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r99848: (compilation-save-buffers-predicate): Date: Fri, 09 Apr 2010 21:04:37 -0400 Message-ID: References: <4BBF536E.4090702@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1270861496 24266 80.91.229.12 (10 Apr 2010 01:04:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 10 Apr 2010 01:04:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: Sam Steingold Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 10 03:04:55 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 1O0P83-0005kU-DI for ged-emacs-devel@m.gmane.org; Sat, 10 Apr 2010 03:04:55 +0200 Original-Received: from localhost ([127.0.0.1]:50836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0P82-0002xo-OR for ged-emacs-devel@m.gmane.org; Fri, 09 Apr 2010 21:04:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O0P7y-0002xh-09 for emacs-devel@gnu.org; Fri, 09 Apr 2010 21:04:50 -0400 Original-Received: from [140.186.70.92] (port=59164 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0P7v-0002xZ-PC for emacs-devel@gnu.org; Fri, 09 Apr 2010 21:04:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O0P7u-0004iU-4U for emacs-devel@gnu.org; Fri, 09 Apr 2010 21:04:47 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:24793 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0P7t-0004iO-Uk; Fri, 09 Apr 2010 21:04:46 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEABJsv0tMCqWu/2dsb2JhbACbQXK6JIJVgjQEiz0 X-IronPort-AV: E=Sophos;i="4.52,180,1270440000"; d="scan'208";a="60569474" Original-Received: from 76-10-165-174.dsl.teksavvy.com (HELO pastel.home) ([76.10.165.174]) by ironport2-out.pppoe.ca with ESMTP; 09 Apr 2010 21:04:37 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 5158281AE; Fri, 9 Apr 2010 21:04:37 -0400 (EDT) In-Reply-To: <4BBF536E.4090702@gnu.org> (Sam Steingold's message of "Fri, 09 Apr 2010 12:18:54 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) 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:123409 Archived-At: >>>> - 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? > I can add a variable compile-default-directory which will be nil globally > and bound to default-directory in compile and recompile; then the users will > be able to set compilation-save-buffers-predicate to > (lambda () > (string-prefix-p > (locate-dominating-file compile-default-directory "foo") > (file-truename (buffer-file-name)))) > so that only files located in the currently compiled project are saved. > here "foo" should identify the project root, it can be, e.g., "configure" or > "COPYING" or "README" or "OMakeroot" or "ANNOUNCE". > we can also use "bzr root"/"hg root" instead of locate-dominating-file. > this, however, becomes more and more expensive. 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). - then we provide an option to "save only files in the current project". - and we can also provide an option to "cd to project's root before running the command". How does that sound? Stefan