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): New custom variable. Date: Wed, 7 Apr 2010 16:40:27 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1270672874 15360 80.91.229.12 (7 Apr 2010 20:41:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 7 Apr 2010 20:41:14 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 07 22:41:11 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 1Nzc3e-00057Q-1o for ged-emacs-devel@m.gmane.org; Wed, 07 Apr 2010 22:41:07 +0200 Original-Received: from localhost ([127.0.0.1]:33129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nzc3c-0003VS-2I for ged-emacs-devel@m.gmane.org; Wed, 07 Apr 2010 16:41:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nzc3V-0003UY-Oc for emacs-devel@gnu.org; Wed, 07 Apr 2010 16:40:57 -0400 Original-Received: from [140.186.70.92] (port=40873 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nzc3Q-0003O6-64 for emacs-devel@gnu.org; Wed, 07 Apr 2010 16:40:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nzc33-0000u5-2Q for emacs-devel@gnu.org; Wed, 07 Apr 2010 16:40:30 -0400 Original-Received: from mail-gy0-f169.google.com ([209.85.160.169]:59691) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nzc32-0000u0-W7 for emacs-devel@gnu.org; Wed, 07 Apr 2010 16:40:29 -0400 Original-Received: by gyg4 with SMTP id 4so873493gyg.0 for ; Wed, 07 Apr 2010 13:40:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:received:message-id:subject :from:to:cc:content-type; bh=naywJtHns4p+jNdpyVBwXJUTg1+xGKiMgzDhJ+OYn8s=; b=qsX1/PW7DxFvb9OaGwD3m98wyd30kLRw7f0LQe2awfK1n1rIAo2h8SmbvUkMmc+BX3 D42WW6YiSnXmPywQyMrYZXJMdv9H9gNQsJNT0KsUAeRS5vh8ODmzhmSjdINCeM86Wtfr SyaAW0sMOh4Lc9eOOPHEH3azrTzLqJ6e/JDwY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=ub2isJyghgPCsqTvtOsl8DnlV24saVAIEDG4+ZShAfTJO/K9U0cf7IzEK5vG1tGJBr GKF19P3opCvp1lf+BElkj6aCK8ctNLWXUI8zeEkd7sT9SHLYWoDNepjbi5ULXmvqpo6i IyvAE17cwZOTchzDDapbuxBTC6z8bEAr8FuNE= Original-Received: by 10.151.157.16 with HTTP; Wed, 7 Apr 2010 13:40:27 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: 48e46affb20b65b9 Original-Received: by 10.150.249.6 with SMTP id w6mr9656803ybh.157.1270672827590; Wed, 07 Apr 2010 13:40:27 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:123335 Archived-At: On 4/7/10, Stefan Monnier wrote: > > ;;;###autoload > > +(defcustom compilation-save-buffers-predicate nil > > + "The second argument (PRED) passed to `save-some-buffers' before compiling. > > +E.g., one can set this to > > + (lambda () > > + (string-prefix-p my-compilation-root (file-truename (buffer-file-name)))) > > +to limit saving to files located under `my-compilation-root'. > > +Note, that, in general, `compilation-directory' cannot be used instead > > +of `my-compilation-root' here." > > + :type '(choice > > + (const :tag "Default (save all file-visiting buffers)" nil) > > + (const :tag "Save all buffers" t) > > + function) > > + :group 'compilation) > > + > > +;;;###autoload > > - Please don't autoload defcustoms unless you have a *really* good > reason to do it (and even then, ask permission first). I autoloaded this one because its sibling compilation-ask-about-save is autoloaded. > - 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. > Could you also explain why `compilation-directory' can't be > used instead? because if you are working on a project foo and compile in directory foo/src, you do want to save buffers editing foo/headers/baz.h, but it is not under compilation-directory, which is foo/src/. -- Sam Steingold