From f0019ede635edc3c5898d6297f4e25769a1ad7c1 Mon Sep 17 00:00:00 2001 From: Martin Blais Date: Wed, 29 Aug 2012 14:15:12 -0400 Subject: [PATCH] * lisp/progmodes/compile.el (compilation-always-kill): New var. (compilation-start): Use it. --- etc/NEWS | 2 ++ lisp/ChangeLog | 5 +++++ lisp/progmodes/compile.el | 8 ++++++++ 3 files changed, 15 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index 1da3931813..e17846cc4d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -207,6 +207,8 @@ It copies the region-rectangle as the last rectangle kill. * Changes in Specialized Modes and Packages in Emacs 24.3 +** Compilation has a new `compilation-always-kill' configuration variable. + ** Term changes The variables `term-default-fg-color' and `term-default-bg-color' are diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 64ccde6705..0fd323a6a2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-29 Martin Blais (tiny change) + + * progmodes/compile.el (compilation-always-kill): New var. + (compilation-start): Use it. + 2012-08-29 Stefan Monnier * simple.el (read-only-mode): Move from files.el for bootstrapping. diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index eb966e8a90..83f31d5c8d 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1503,6 +1503,13 @@ Otherwise, construct a buffer name from NAME-OF-MODE." (compilation-start command nil name-function highlight-regexp))) (make-obsolete 'compile-internal 'compilation-start "22.1") +(defcustom compilation-always-kill nil + "If nil, ask to kill compilation. If 't, always kill an +incomplete compilation before starting a new one." + :type 'boolean + :version "24.3" + :group 'compilation) + ;;;###autoload (defun compilation-start (command &optional mode name-function highlight-regexp) "Run compilation command COMMAND (low level interface). @@ -1537,6 +1544,7 @@ Returns the compilation buffer created." (let ((comp-proc (get-buffer-process (current-buffer)))) (if comp-proc (if (or (not (eq (process-status comp-proc) 'run)) + compilation-always-kill (yes-or-no-p (format "A %s process is running; kill it? " name-of-mode))) -- 2.20.1