unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Sam Steingold <sds@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
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	[thread overview]
Message-ID: <g2r1f77704b1004071340x8ca28d2yfb9b59a57b2f1444@mail.gmail.com> (raw)
In-Reply-To: <jwvmxxfccrq.fsf-monnier+emacs@gnu.org>

On 4/7/10, Stefan Monnier <monnier@iro.umontreal.ca> 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 <http://sds.podval.org>




  reply	other threads:[~2010-04-07 20:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1NzYsW-0004b6-Iu@internal.in.savannah.gnu.org>
2010-04-07 19:00 ` [Emacs-diffs] /srv/bzr/emacs/trunk r99848: (compilation-save-buffers-predicate): New custom variable Stefan Monnier
2010-04-07 20:40   ` Sam Steingold [this message]
2010-04-09  3:13     ` [Emacs-diffs] /srv/bzr/emacs/trunk r99848: (compilation-save-buffers-predicate): Stefan Monnier
2010-04-09 16:18       ` Sam Steingold
2010-04-10  1:04         ` Stefan Monnier
2010-04-11 19:21           ` Sam Steingold
2010-04-11 20:28             ` Stefan Monnier
2010-04-12 20:02               ` Sam Steingold
2010-04-12 21:15                 ` Stefan Monnier
2010-04-12 21:47                   ` Sam Steingold
2010-04-13  0:04                     ` Stefan Monnier
2010-04-13 17:07               ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=g2r1f77704b1004071340x8ca28d2yfb9b59a57b2f1444@mail.gmail.com \
    --to=sds@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).