# HG changeset patch # User Katsumi Yamaoka # Date 1270736002 0 # Node ID 962b581f9cc792e177f0c39cac8146cee2473b86 # Parent 79bd972a5a7d05d3a4147de906a1d1d892f45450# Parent 25be388c76cc353407bfbfaa2dc9f6eb246e5a2d Merge from mainline. diff -r 79bd972a5a7d -r 962b581f9cc7 lisp/ChangeLog --- a/lisp/ChangeLog Wed Apr 07 14:24:02 2010 +0000 +++ b/lisp/ChangeLog Thu Apr 08 14:13:22 2010 +0000 @@ -1,3 +1,9 @@ +2010-04-07 Sam Steingold + + * progmodes/compile.el (compilation-save-buffers-predicate): New + custom variable. + (compile, recompile): Pass it to `save-some-buffers'. + 2010-04-07 Jan Djärv * wid-edit.el (widget-choose): Move cursor to the second line of diff -r 79bd972a5a7d -r 962b581f9cc7 lisp/progmodes/bug-reference.el --- a/lisp/progmodes/bug-reference.el Wed Apr 07 14:24:02 2010 +0000 +++ b/lisp/progmodes/bug-reference.el Thu Apr 08 14:13:22 2010 +0000 @@ -130,6 +130,7 @@ (widen) (bug-reference-unfontify (point-min) (point-max))))) +;;;###autoload (defun turn-on-bug-reference-mode () "Unconditionally turn bug reference mode on." (unless bug-reference-mode @@ -148,6 +149,7 @@ (widen) (bug-reference-unfontify (point-min) (point-max))))) +;;;###autoload (defun turn-on-bug-reference-prog-mode () "Unconditionally turn bug reference prog mode on." (unless bug-reference-prog-mode diff -r 79bd972a5a7d -r 962b581f9cc7 lisp/progmodes/compile.el --- a/lisp/progmodes/compile.el Wed Apr 07 14:24:02 2010 +0000 +++ b/lisp/progmodes/compile.el Thu Apr 08 14:13:22 2010 +0000 @@ -584,6 +584,21 @@ :group 'compilation) ;;;###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 (defcustom compilation-search-path '(nil) "List of directories to search for source files named in error messages. Elements should be directory names, not file names of directories. @@ -1097,7 +1112,8 @@ (consp current-prefix-arg))) (unless (equal command (eval compile-command)) (setq compile-command command)) - (save-some-buffers (not compilation-ask-about-save) nil) + (save-some-buffers (not compilation-ask-about-save) + compilation-save-buffers-predicate) (setq-default compilation-directory default-directory) (compilation-start command comint)) @@ -1108,7 +1124,8 @@ original use. Otherwise, recompile using `compile-command'. If the optional argument `edit-command' is non-nil, the command can be edited." (interactive "P") - (save-some-buffers (not compilation-ask-about-save) nil) + (save-some-buffers (not compilation-ask-about-save) + compilation-save-buffers-predicate) (let ((default-directory (or compilation-directory default-directory))) (when edit-command (setcar compilation-arguments