emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r99848: (compilation-save-buffers


From: Sam Steingold
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

On 4/7/10, Stefan Monnier <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]